just doing pointer copy again

This commit is contained in:
Dan Buch 2011-09-10 00:33:57 -04:00
parent c5e4c2cf26
commit de57b63f46

5
ex11.c
View File

@ -1,5 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -23,8 +22,8 @@ int main(int argc, char *argv[])
i = 0; i = 0;
while(i < num_states) { while(i < num_states) {
strcpy((char *)(&states[i]), argv[i]); states[i] = argv[i];
printf("copied %s into state %d\n", argv[i], i); printf("copied %s into state %d\n", states[i], i);
i++; i++;
} }