December 3rd, 2013, 10:02 AM
Please help me with arrays
I have a homework to create some arrays but at a point the elements of the array must be strings. i can give an example
MyArray = "Username";
I can solve this problem using pointers but my teacher told me not to use pointers if i use he will cancel my homework
Can anyone help me?
By the way he said that i can use string.h library but i coudn't use that!!
December 3rd, 2013, 10:18 AM
STOP SHOUTING AT US!
So use a 2-D array of char. Each row will contain a string. Make the number of columns large enough to accommodate the longest string plus one more for the null-terminator.
And don't ever shout at us again.