can we type while ( "variable" = '\n') ? or an error will occur?

You mean like this?

char c;
while( c != '\n' )
{
    // blabla
}

You mean like this?

char c;
while( c != '\n' )
{
    // blabla
}

yes but i think you must put == (just found out ) cause just = is a mistake

I wrote != (not equal to), which is the opposite of == (equal to).

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.