- #1
jpatterson
- 3
- 0
I'm new to C, so this is probably a dumb question, but I'd appreciate help. If I create (or think I create, anyway) an array of strings with:
char *array_name[10]
and then try to populate an element of the array with:
gets(array_name[0])
everything compiles ok, but I get a runtime error complaining about an access violation.
What is the proper way to create an array of strings and populate one of the elements of the array using gets?
Thanks in advance.
char *array_name[10]
and then try to populate an element of the array with:
gets(array_name[0])
everything compiles ok, but I get a runtime error complaining about an access violation.
What is the proper way to create an array of strings and populate one of the elements of the array using gets?
Thanks in advance.