Jump to content

Programming interest unna vaallu itu randi!!!!!


Recommended Posts

Posted

[quote author=TollywoodEmperor link=topic=127624.msg1411343#msg1411343 date=1291164987]
second daniki 5 print avuthundha?

i can write that statement as follows:  long *p; p=&a;
*p=?    p is address of a...When we dereference it , we get storage value = 5;
[/quote]
its not so much about dereferencing mama..ante in the context of this question..format specifier lo %ld %lld pettanu..okati long, inkoti long long..if long = int, then no problem..if long > int, then u have a problem..

  • Replies 199
  • Created
  • Last Reply

Top Posters In This Topic

  • krldr871

    34

  • dkchinnari

    31

  • chipanjichiru

    27

  • andhrabalayya

    22

Posted

[quote author=Leader871 link=topic=127624.msg1411351#msg1411351 date=1291165154]
its not so much about dereferencing mama..ante in the context of this question..format specifier lo %ld %lld pettanu..okati long, inkoti long long..if long = int, then no problem..if long > int, then u have a problem..
[/quote]  thankyou thankyou thankyou sHa_fr1ends

Posted

[quote author=Leader871 link=topic=127624.msg1411347#msg1411347 date=1291165050]
mama garbage ante enti..it is quite common to find this term in basic textbooks..at least nenu first chadivinappudu garbage ante ento ankunevaadini..
lets say u declare a variable and dont initialize it..assuming it is a local variable..stack lo memory allocate avthadi..aa particular address lo previous ga unna value alane untadi andulo..so print cheste neku kavaalsina or expctd value raadu..or inka neat ga cheppalante evadoo vaadesina memory ni nuvvu unchukuntunav..so garbage ani antaaru..
andhrabalayya correct me if im wrong  sSc_hiding2 sSc_hiding2
[/quote]

nu cheppidhi correcte mama and grabage ante some random value which isgenerated by system..

Posted

Ok guys..nenu jump inka..ee thread ni continue cheddam kudirite  sHa_high5ing sHa_high5ing sHa_high5ing

Posted

[quote author=Leader871 link=topic=127624.msg1411417#msg1411417 date=1291165914]
Ok guys..nenu jump inka..ee thread ni continue cheddam kudirite  sHa_high5ing sHa_high5ing sHa_high5ing
[/quote]
bye1 sure

Posted

question: where did you get this "4 bytes" ,"8 Bytes"from ??
[quote author=Leader871 link=topic=127624.msg1411326#msg1411326 date=1291164824]
error kadu..warning vastadi obviously 1st daniki..
%lld ante long long..usually long long size is bigger than that of an int..so aa p ki sambandinchina 4 bytes kakunda inkoka 4 bytes..motham 8 bytes lo unde value print avutundi..assuming long long is 8 bytes lng
[/quote]

Posted

[quote author=ChittiNaidu link=topic=127624.msg1411433#msg1411433 date=1291166036]
[img]http://www.gifsoup.com/imager.php?id=1348422[/img]  vachesava baa....
[/quote]
[img width=216 height=90]http://img534.imageshack.us/img534/5434/venkybrahmi.gif[/img]

Posted

[quote author=Leader871 link=topic=127624.msg1411417#msg1411417 date=1291165914]
Ok guys..nenu jump inka..ee thread ni continue cheddam kudirite  sHa_high5ing sHa_high5ing sHa_high5ing
[/quote]  bye bye

Posted

Segmentation fault ... It's writing to a random address.

[quote author=dkchinnari link=topic=127624.msg1411229#msg1411229 date=1291163473]

printf("%d',*a) answer 5 aa baa
[/quote]

Posted

[quote author=andhrabalayya link=topic=127624.msg1411441#msg1411441 date=1291166138]
question: where did you get this "4 bytes" ,"8 Bytes"from ??
[/quote]

may be they are type sizes. like int size and long size.

Posted

Pointers to different types of data are not guaranteed to be compatible in the language.  Substituting a pointer-to-long-int for a pointer-to-longlong is implementation dependent.
[quote author=Leader871 link=topic=127624.msg1411312#msg1411312 date=1291164680]
well actually %lld is sufficient and i dont have to cast it to a long..
printf(%lld",p);

it would try to print out 8 bytes from that p's starting address..
[/quote]

Posted

again where did you get this "4 bytes" from ?  sCo_hmmthink
[quote author=Leader871 link=topic=127624.msg1411274#msg1411274 date=1291164070]
segmentation fault vastadi baa..we r trying to access some random address n trying to print the value of 4 bytes from the starting address
[/quote]

Posted

an int is not guaranteed to be 4 bytes.  In fact, its supposed to be the size of a processor's register, but even that's not always true.
[quote author=ChittiNaidu link=topic=127624.msg1411447#msg1411447 date=1291166171]
lld and ld nunchi vahcyai anukunta... sCo_hmmthink sCo_hmmthink
[/quote]

Posted

an int is not guaranteed to be 4 bytes.  In fact, its supposed to be the size of a processor's register, but even that's not always true.
[quote author=TollywoodEmperor link=topic=127624.msg1411476#msg1411476 date=1291166490]
may be they are type sizes. like int size and long size.
[/quote]

×
×
  • Create New...