void getinput(char sentence)
{
	cout << "enter something => " << endl;
	char ch;
	cin.get(ch);
	int count = 0;
	int i = 0;
	while(ch >= ' ' || count >= SIZE)
	{
		if (isalpha(ch))
		{
		[B]	sentence[i] = ch; [/B]
			i++;
		}
		cin.get(ch);
		count++;
	}
	
}

This is the function I wrote, the part in bold cannot be compiled for some reason. Can the veterans point a noob the right direction please?

Recommended Answers

All 2 Replies

uhhmmm.... sentence is a single char.

void func(sting &str)
{
    bool alpha = true;

    getline(cin, str);
    while(alpha)
    {
        /*code*/
    }
}

wow...(slaps self on forehead) I'm truly a newb :P thanks buddy.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.