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 |
Write a C++ program to give the number of days in each month according to what the user entered. example: the user enters June the program must count number of days from January up to June
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Is it possible to run using programming C for Java Application?
Define macros.
what is answer for perfect number????????????????
Write a routine that prints out a 2-D array in spiral order!
write a program to print data of 5 five students with structures?
What are the advantages of using new operator as compared to the function malloc ()?
HOW TO HANDLE EXCEPTIONS IN C
Program to trim a given character from a string.