0
How to do this program in C?
write a function that accepts a string. then it increase the alphabet of the string by 1(z become a). it than stores the new string in another string and returns that string.
6 Antworten
+ 2
Not C++, it is allowed to do :
int * a = new int[n];
But not :
int a[n];
+ 2
It would create a rather big problem. It would mean that either compiler add free by itself at the end of the scope, or the stack size can change during the execution (which is impossible)
+ 1
And as I worked with gcc, I always had errors with it (C90), I do not know for sure for C99
+ 1
I am curious as of how the compiler do with this case.
My guess would be a const pointer deleted at the end of its scope, but I do not know what would happen if the allocation failed
0
ns is not taking any string
0
@kurwius
char[not constant] is forbidden