Click here to Skip to main content
15,920,513 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to egalise two strings Pin
F.Falk27-Jul-07 0:24
F.Falk27-Jul-07 0:24 
AnswerRe: How to egalise two strings Pin
ashukasama27-Jul-07 0:24
ashukasama27-Jul-07 0:24 
AnswerRe: How to egalise two strings Pin
garfaoui27-Jul-07 0:38
garfaoui27-Jul-07 0:38 
GeneralRe: How to egalise two strings Pin
mandanani27-Jul-07 0:36
mandanani27-Jul-07 0:36 
QuestionRe: How to egalise two strings Pin
garfaoui27-Jul-07 0:39
garfaoui27-Jul-07 0:39 
AnswerRe: How to egalise two strings Pin
mandanani27-Jul-07 0:46
mandanani27-Jul-07 0:46 
QuestionRe: How to egalise two strings Pin
garfaoui27-Jul-07 0:50
garfaoui27-Jul-07 0:50 
AnswerRe: How to egalise two strings Pin
Cedric Moonen27-Jul-07 0:58
Cedric Moonen27-Jul-07 0:58 
I think you have to understand how strings function. What are c1 and f1 ? char pointers, std::string or CString ? Without knowing that we can't really help you.

If these are standard char pointers, you need to use strcpy to be able to store one string in the array (but first, it must be allocated with enough size). Then, you can compare two strings using strcmp function.

Everything has already been told before.

So a code example:
char string1[255];<br />
char string2[255];<br />
<br />
strcpy(string1,"Test");<br />
strcpy(string2,"Test");<br />
if (strcmp(string1,string2) == 0)<br />
cout << "Strings are equal";<br />
else<br />
cout << "Strings are different";


Check the documentation of the functions on MSDN to be sure you understood correctly the concept.




Cédric Moonen
Software developer

Charting control [v1.2]

AnswerRe: How to egalise two strings Pin
toxcct27-Jul-07 0:57
toxcct27-Jul-07 0:57 
GeneralRe: How to egalise two strings Pin
Cedric Moonen27-Jul-07 0:59
Cedric Moonen27-Jul-07 0:59 
GeneralRe: How to egalise two strings Pin
Jonathan [Darka]27-Jul-07 1:08
professionalJonathan [Darka]27-Jul-07 1:08 
GeneralRe: How to egalise two strings Pin
Cedric Moonen27-Jul-07 1:11
Cedric Moonen27-Jul-07 1:11 
GeneralRe: How to egalise two strings [modified] Pin
toxcct27-Jul-07 1:11
toxcct27-Jul-07 1:11 
QuestionRe: How to egalise two strings Pin
garfaoui27-Jul-07 2:10
garfaoui27-Jul-07 2:10 
AnswerRe: How to egalise two strings Pin
toxcct27-Jul-07 2:19
toxcct27-Jul-07 2:19 
AnswerRe: How to egalise two strings Pin
ShilpiP27-Jul-07 2:11
ShilpiP27-Jul-07 2:11 
GeneralRe: How to egalise two strings Pin
toxcct27-Jul-07 2:14
toxcct27-Jul-07 2:14 
GeneralRe: How to egalise two strings Pin
garfaoui27-Jul-07 2:18
garfaoui27-Jul-07 2:18 
GeneralRe: How to egalise two strings Pin
toxcct27-Jul-07 2:21
toxcct27-Jul-07 2:21 
JokeRe: How to egalise two strings Pin
CPallini27-Jul-07 2:27
mveCPallini27-Jul-07 2:27 
GeneralRe: How to egalise two strings Pin
toxcct27-Jul-07 2:31
toxcct27-Jul-07 2:31 
GeneralRe: How to egalise two strings Pin
CPallini27-Jul-07 2:37
mveCPallini27-Jul-07 2:37 
GeneralRe: How to egalise two strings Pin
garfaoui27-Jul-07 2:28
garfaoui27-Jul-07 2:28 
GeneralRe: How to egalise two strings Pin
toxcct27-Jul-07 2:32
toxcct27-Jul-07 2:32 
GeneralRe: How to egalise two strings Pin
garfaoui27-Jul-07 2:35
garfaoui27-Jul-07 2:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.