Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

새싹교실/2017/내무반/박채린/포인터실습: Difference between revisions

From ZeroWiki
({CREATE})
 
No edit summary
 
Line 1: Line 1:
#include <stdio.h>
#include &lt;stdio.h&gt;
 
int main(){
int main(){
 
char str&#91;10&#93;;
char str[10];
char * p_str = 0;
char * p_str = 0;
 
scanf_s("%s", str);
scanf_s("%s", str);
 
p_str = &str&#91;4&#93;;
p_str = &amp;str[4];
*p_str = '@';
*p_str = '@';
 
p_str = &str;
p_str = &amp;str;
printf("%s", p_str);
printf("%s", p_str);
 
return 0;
return 0;
}
}



Latest revision as of 11:03, 30 May 2017

#include <stdio.h>

int main(){

	char str[10];
	char * p_str = 0;

	scanf_s("%s", str);

	p_str = &str[4];
	*p_str = '@';

	p_str = &str;
	printf("%s", p_str);

	return 0;
}