Commontater: Dude..i got a lil confused with that but Thanks yet again!
Type: Posts; User: *al
Commontater: Dude..i got a lil confused with that but Thanks yet again!
Stack!! I guess that solves it.Thats what i was wondering too.but i wasnt sure if this is what is really happening.
and hey thanks for the insight and sorry for the trouble!
so u r saying that i am giving p 5 as its address.and then i am printing 5? I dont think thats a legal statement .i cant just assign an address value to whatever i please.address is fixed.aint it?
main()
{
int *p,x=5;
p=&x;
printf("value of x is %d\n",*p); //
printf("Address of x is %u\n",p); // i am printing the value of p here.but hey look i dont get 5.
}
p is pointing to the int...
I just want to how this code is working
main()
{
int *p = 5;
printf("%d\n",p);
}
Well,i am actually glad that i got the help needed 'eventually'.
I wouldnt say i made a mistake in that code.I was rather playing to see what output i would get if i change a few things in it.And...
Oh ok i got it.Thanks buddy.
And i do apologise for apparently posting something in a wrong fashion.In my defense I wanna say that i am new and quite unsure about what exact mistake u r pointing...
CommonTater... Thanks a lot.Your information was really helpful and cleared my doubts.
I have set warnings to level 2.although it is not showing any such message about two code sections.
...
Q.1 ok so when i use printf("%c",putchar(c)); and i get two n's ...which n is the first one being printed...the one by putchar() or by printf().
Q.2 and if "%c" is being assigned a value by...
#include<stdio.h>
main()
{
{
int c;
printf("Enter a character:");
c=(int)getchar();
if(c=='y'||c=='Y')