TCS
Company
Programming
What should the program below print?
#include
#include
#include
void myfunc(char** param){
++param;
}
int main(){
char* string = (char*)malloc(64);
strcpy(string, "hello_World");
myfunc(&string);
myfunc(&string);
printf("%sn", string);
// ignore memory leak for sake of quiz
return 0;
}
1. hello_World
2. ello_World
3. lo_World
4. llo_World
Read Solution (Total 4)
-
- option 1 is correct
- 6 years agoHelpfull: Yes(4) No(2)
- It should print ello_world because by ++param will move to 2 position of string
- 6 years agoHelpfull: Yes(1) No(1)
- its print hello_world
- 6 years agoHelpfull: Yes(0) No(2)
- hello_World
- 6 years agoHelpfull: Yes(0) No(1)
TCS Other Question