Hey everyone!
Just started programming in C (I use visualstudio 2010 pro.) and have previously programmed in C#.
I have this(ese) really, really basic question(s) about chars and strings;
I want to have compare and set strings.
I already know how to compare, by using the "strcmp", now however I have trouble how to figure out how to initiate string/chararray variables with a string I choose. (C# made me spoiled)
I.E.
I have a function that receives a string from the prompt (don't think about that, just explaining this so you can understand better);
Just started programming in C (I use visualstudio 2010 pro.) and have previously programmed in C#.
I have this(ese) really, really basic question(s) about chars and strings;
I want to have compare and set strings.
I already know how to compare, by using the "strcmp", now however I have trouble how to figure out how to initiate string/chararray variables with a string I choose. (C# made me spoiled)
I.E.
I have a function that receives a string from the prompt (don't think about that, just explaining this so you can understand better);
Code:
choice = GetLine(); //Here's the tricky part I can't figure out; if(choice = "exit"){ do this; }
Comment