Cannot determine why pointer variable will not address elements in a string in this program?
- by Smith Will Suffice
I am attempting to utilize a pointer variable to access elements of a string and there are issues with my code generating a compilation error:
#include <stdio.h>
#define MAX 29
char arrayI[250];
char *ptr;
int main(void)
{
ptr = arrayI;
puts("Enter string to arrayI: up to 29 chars:\n");
fgets(arrayI, MAX, stdin);
printf("\n Now…