Hi there, this is my first post, but i can see I'll be writting here often!
The long and short of it is, as a beginner, i get set tasks by my lefcturer, one of my current tasks is relitively easy compared to some of the others i have, although i have one major problem.
When i enter the string (as a character array) it considers the spaces in my sentances to be enters, for example the code below
when i compile it using microsoft visual c++ (though as .c file) you dont get the full sentance entered as a string, only each word.
/*Program to sort and output the longest of 6 user defined strings*/ /*mitchell kent 323386*/
printf("Longest string finder\n");
printf("Please enter your six sentences, no longer than 20 characters each\n\n");
printf("\nYour longest string(s) can be seen below, %d characters in length:\n",maxlength);
we havent yet learnt how to use pointers, nor any functions for user input other than scanf. I have looked around and have seen the gets() or somethng similar, though have never seen it being used without pointers...
any help would be greatly appreciated (and this assignment is due in v soon, so any help would be grateful, any quick replies would be fantastic!)
(just to be clear, if you wrote the sentence "hi there my name is mitchell" it would consider that 6 strings of individual words, where as i want that to be one string)