Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
str_ptr_to_fumc_v2
//gcc 5.4.0 #include <stdio.h> int c; typedef struct { int a; char str[100]; char str2[100]; int b; }str_samp; str_samp sample, *sptr, *ssptr; int func(int *a, char *rstr, char *pstr) { *a=6; strcpy(rstr,"Hello"); strcpy(pstr,rstr); //*(rstr+5)='!'; strcat(rstr," Good luck."); *(rstr+15)='!'; memmove(pstr+5,rstr+10,5); *(pstr+10)='!'; return(*a); } int main(void) { sample.a=50; sample.b=100; memset(sample.str2,99,0); memset(sample.str,99,'0'); sptr = &sample; ssptr = &sample; c=func(&sptr->a,sptr->str,ssptr->str2); printf("a=%d, b=%d, c=%d, str:%s, str2:%s", sample.a, sample.b, c, sample.str, sample.str2); return 0; }
run
|
edit
|
history
|
help
0
Part 1: Draw Arts (square)
Cuenta codigos
Practice flipping the stars
incrementing values in an array
TeleBook2
a1
strcmp
19BCE0666.C
B_141209_TrianguloTartalia
A_141117_Primo02