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

Code:
/*


/*Program to sort and output the longest of 6 user defined strings*/ /*mitchell kent 323386*/


#include <stdio.h>
#include <string.h>

int main(void)
{
	char lengthystring[6][100];
	int loop,maxlength,length;

	printf("Longest string finder\n");
	printf("=-=-=-=-=-=-=-=-=-=-=\n\n");

	printf("Please enter your six sentences, no longer than 20 characters each\n\n");


	for(loop=0;loop<=5;loop++)
	{
	scanf(" %s",lengthystring[loop]);
	}

	printf("\n");

	maxlength=strlen(lengthystring[0]);

	for(loop=0;loop<=5;loop++)
	{
	length=strlen(lengthystring[loop]);
	if(length>maxlength)
		maxlength=length;

	}

	printf("\nYour longest string(s) can be seen below, %d characters in length:\n",maxlength);
	
	for(loop=0;loop<=5;loop++)
	{
		if(strlen(lengthystring[loop])==maxlength)
			printf("\n%s\n",lengthystring[loop]);
	}

	printf("\n");
	return 0;
}

*/
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.

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!)

Yours
Mitch


(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)
Cheers!