Why is the code below functioning. According to me it MUST
NOT.
Answer / h0rryp0tter
Please have a look at the code below :
char str[1];
int i = 0;
void revstr(void);
int main(void)
{
revstr();
printf("%s\n",str);
return 0;
}
void revstr(void)
{
char c = getchar();
if (c!= EOF) {
revstr();
str[i++] = c;
}
str[i] = '\0';
}
Written using Bloodshed Dev C++.
I am trying to access and write on an char array which has
been defined with only one element in it. The above code
must give me Errors of some kind. But on the contrary, it
works.
| Is This Answer Correct ? | 0 Yes | 1 No |
main() { int i=5; printf("%d%d%d%d",i++,i--,i); }
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }
write a function that accepts an integer/char array and an search item.If the search item is there in the array return position of array and value else return -1.without using other array,without sorting,not to use more than one loop?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.
sir i got 146 correct question & i have also the advantage of height so will they consider my marks as 146+3=149.can any body tell me how they consider my height marks.
write a c program to check weather a particluar bit is set or not?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
What is a null string in c?
Explain the difference between structs and unions in c?
What is "Duff's Device"?