/* * File Name: StringAsParameters.c * Author: MH * Since 2013/03/25 * Toolkit: Dev C++ 4.9.9.9 */ #include <stdio.h> int main(){ void change(char *); char s[] = "abcdefg"; char t[] = "ijklmnop"; change(s); change(t); puts(s); // ab$de+g puts(t); // ij$lm+op return 0; } void change(char *x){ *(x+2) = '$'; // x[2]='$'; *(x+5) = '+'; // x[5]='+'; }
沒有留言:
張貼留言