kay there's a big back story but to cut to the chase, for one part of my program I have to allow the user to type whatever they want (up to 60 characters, I completed that part) but after the 10th character it goes to a new line. I have looked everywhere and I cannot find a good way to solve this.
This is what I have out so far and I get infinie loop:
//Set the line limit to 10 characters
char d;
int j = 0;
char stu[] = "Example sentence to test isspace\n";
while (stu[j])
{
d = str[j];
if (j = 11)
d = '\n';
putchar(d);
j++;
}
Also, I just joined this forum five minutes ago so heyyy
Okay thank you! That worked, but now what I also need to figure out is not how to make character 11 a '\n' but to ADD it in there and move every character over 1. Because right now it prints: