476 views
0 votes
0 votes

 

#include <stdio.h>
 
int main(void) {
	char s1[15]="SREE";
	char s2[10]="ALL THE BEST";
	strcpy(s2,s1);
	printf("\n%s",s2);
	return 0;
}

1)How s2 will contain a string of size 12, while it only contain size 10?

2)Why strcpy will not merge the rest string of s2 with s1 after copying , I mean “SREETHE BEST”

Will it work like pointer that s2 pointing to same as s1?

Anything link good to read about strcpy

Please log in or register to answer this question.

Related questions

2 votes
2 votes
0 answers
1
srestha asked Mar 5, 2019
1,147 views
What will be output of the program?int d=0; int f(int a,int b){ int c; d++; if(b==3) return a*a*a; else{ c=f(a,b/3); return(c*c*c); } } int main(){ printf("%d",f(4,81)); ...
3 votes
3 votes
0 answers
2
Asim Abbas asked Jan 11, 2018
439 views
Answer of this question is given as (C), but I am not able to get it how. Can any1 please explain this?
1 votes
1 votes
0 answers
3
0 votes
0 votes
1 answer
4
Hemant Parihar asked Feb 3, 2017
520 views
#include<stdio.h>int main() { char *p; p = "%d\n"; p++; p++; printf(p-2, 400); return 0;}Output : 400I ran this program and got 400 as output. But I don...