Inept Programmer needs help

Well well.. i am quite spoiled after doing a few years of C# - so now i am totally confused on how to do something quite easy.. How do i do this:

IF (variable == "some text") in C?

I cant believe i cannot find an answer myself ><

You can use strcmp to compare two strings:

if (strcmp(string1, "some text") == 0) {
// they are equal, do something here
}

ah thanks, i knew there was a function for that ^^

ok, just another question that i didnt find answered in the forum (sorry):

Code:

if (strcmp(linea[j+1], "V") ) {
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);
}else
{
digitalWrite(ledGreen, LOW);
digitalWrite(ledRed, HIGH);
}

Giving error: invalid conversion from 'char' to 'const char* for the strcmp line.
Is there a trick i miss?

(Man, C# makes you forget sooo many things...)

invalid conversion from 'char' to 'const char* for the strcmp line.

Without seeing the definition of linea, we can only speculate. My speculation is that linea is an array of characters (or pointer to char) thus making linea[j+1] be of type char. You can't pass a character argument to a function expecting a pointer to a character, hence the error message.

If you want to compare the character at linea[j+1] with the character 'V', you can simply do:
If(linea[j+1] == 'V') {

If you want to compare a string starting at position linea[j+1] with a constant string "V is a string”), you can do:
if (strcmp(&linea[j+1], "V is a string") ) {