I'm new to C coming from Java. Just explain me why this:
text[0] = 'a';
is not possible, my program just crashes.
#include "caesarHead.h"
#include <limits.h>
int main(void) {
caesar("Hello this is a sample text", 12);
printf("\n\n");
}
void caesar(char text[], char offset) {
int i = 0;
text[0] = 'a';
char *p = text;
for (p; *p != '\0'; p++) {
printf("String: %c \n", text[i]);
printf("Ascii: %i \n", (int)text[i]);
i++;
}
}