I tried many things but I just cant find any solution to the problem. I am trying to print the contents of an array one by one but it crashes. How can I make each index corresponding letter print out after each iteration?
main() {
int i;
char myArray[10];
for(i = 0; i < 5; i++) {
myArray[i] = "a";
printf("%s\n", myArray[i]);
}
}
I also tried:
printf("%c\n", myArray[i])
and:
printf("%d\n", (int)myArray[i]) gives me the numbers 36.
arr[i]? I don't see anarrdeclared (or initialized) anywhere.