Change length of name to 5 to make manipulation easier.
Print out the individual characters of name[]. Use Print_point() function in print_vars(). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7464 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
455035e04e
commit
798499eff7
1 changed files with 3 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ double dvar = 0;
|
||||||
char *strvar = 0;
|
char *strvar = 0;
|
||||||
const char cstrvar[] = "Goodbye";
|
const char cstrvar[] = "Goodbye";
|
||||||
int *iptrvar = 0;
|
int *iptrvar = 0;
|
||||||
char name[256] = "Dave";
|
char name[5] = "Dave";
|
||||||
char path[256] = "/home/beazley";
|
char path[256] = "/home/beazley";
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -48,8 +48,8 @@ void print_vars() {
|
||||||
printf("strvar = %s\n", strvar ? strvar : "(null)");
|
printf("strvar = %s\n", strvar ? strvar : "(null)");
|
||||||
printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)");
|
printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)");
|
||||||
printf("iptrvar = %p\n", iptrvar);
|
printf("iptrvar = %p\n", iptrvar);
|
||||||
printf("name = %s\n", name);
|
printf("name = %c%c%c%c%c\n", name[0],name[1],name[2],name[3],name[4]);
|
||||||
printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0);
|
printf("ptptr = %p %s\n", ptptr, Point_print( ptptr ) );
|
||||||
printf("pt = (%d, %d)\n", pt.x, pt.y);
|
printf("pt = (%d, %d)\n", pt.x, pt.y);
|
||||||
printf("status = %d\n", status);
|
printf("status = %d\n", status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue