.find the output of the following program?
char*myfunc(char*ptr)
{
ptr +=3;
return (ptr);
}
int main()
{
char*x,*y;
x="HELLO";
y=myfunc(x);
printf("y = %s
",y);
return 0;
}



.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } in..

Answer / Vikas Singh

The given C program creates a function named myfunc that takes a character pointer as an argument and increases its value by 3. When this function is called with the string "HELLO", it returns a new pointer pointing to the modified string "HELLO+3". In the main function, the returned pointer is stored in the y variable, and then printed out. The output of the program would be: y = LOOO.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

The variables are int sum=10,SuM=20; these are same or different?

3 Answers  


Explain a pre-processor and its advantages.

1 Answers  


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

1 Answers   Wipro,


Why is C language being considered a middle level language?

1 Answers  


implement general tree using link list

1 Answers   Wipro,


List some of the static data structures in C?

1 Answers  


What are the features of c language?

1 Answers  


Without using main fn and semicolon,print remainder for a given number in C language

2 Answers  


#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output?

5 Answers   Ramco,


Are pointers integers in c?

1 Answers  


What does the c in ctime mean?

1 Answers  


What is use of null pointer in c?

1 Answers  


Categories