.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;
}
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 |
The variables are int sum=10,SuM=20; these are same or different?
Explain a pre-processor and its advantages.
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
Why is C language being considered a middle level language?
implement general tree using link list
List some of the static data structures in C?
What are the features of c language?
Without using main fn and semicolon,print remainder for a given number in C language
#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?
Are pointers integers in c?
What does the c in ctime mean?
What is use of null pointer in c?