I am trying to get this program to work for me and I believe I am missing a few things. The program will ask the user to enter a string or sentence up to 50 or more characters. Then it will re print what the user has inputted in lines of 30-35. Then it will prompt the user to pick a letter and it will find how many letters are in that string or sentence... Here is what I have so far.
//this program is to make a long line of text look
//more presentable to the user.
#include<stdio.h>
#include<string.h>
#define linelen 30
void main (void)
{
int string_length;
int count;
char text[80];
char line[linelen];
printf("\nPlease Enter a long line of text(Greater than 50 characters):\n");
gets(text);
string_length=strlen(text);
for(count=0;count<string_length;count++)
{
if(line[strlen(line) - 1]=='\n');
printf("%c\n\n",line);
}
printf("\n The Length of the string is: %d", string_length);
}