Click here to Skip to main content
15,924,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ??? Pin
Miszou14-Jul-03 9:58
Miszou14-Jul-03 9:58 
GeneralRe: ??? Pin
Anthony_Yio15-Jul-03 1:07
Anthony_Yio15-Jul-03 1:07 
GeneralIR data entry system Pin
teanomilk13-Jul-03 20:32
teanomilk13-Jul-03 20:32 
GeneralRe: IR data entry system Pin
jan larsen14-Jul-03 2:34
jan larsen14-Jul-03 2:34 
GeneralCallBack Function Pin
rohit.dhamija13-Jul-03 19:46
rohit.dhamija13-Jul-03 19:46 
GeneralRe: CallBack Function Pin
Tibor Blazko13-Jul-03 19:59
Tibor Blazko13-Jul-03 19:59 
GeneralRe: CallBack Function Pin
Ryan Binns13-Jul-03 22:51
Ryan Binns13-Jul-03 22:51 
General!strcmp Pin
DaveE9th13-Jul-03 19:37
DaveE9th13-Jul-03 19:37 
In the code below, I'm curious about the "!" in front of the strcmp function. I'm confused on this. In my understanding, the !strcmp is saying that IF str and Info do NOT compare, then cout the number. What am I missing hear? Thanks

#include "iostream.h"<br />
#include "string.h"<br />
<br />
int main()<br />
{<br />
	int x;<br />
	int i;<br />
	char str[80];<br />
	bool isfinished=false;<br />
	char Info [] [300] = <br />
	{<br />
		"3030-02-000-5287" , "Here is the information for this number." ,<br />
		"3030-03-000-0029" , "Here is the information for this number." ,<br />
};<br />
	while(isfinished==false)<br />
	{<br />
		cout<<"\nPlease enter a number:\n";<br />
        cin>>str;<br />
	    for(i=0; i < 4; i += 2)<br />
		if(!strcmp(str, Info[i]))<br />
		{<br />
			cout<<"\nInformation:"<<Info[i+1]<<"\n";<br />
			break;<br />
		}<br />
		    if(i == 4)<br />
			{<br />
				cout<<"Number not found.\n";<br />
			}<br />
			<br />
			cout<<"\nWould you like to check another?\n";<br />
			<br />
			{<br />
				cout<<"Enter 1 for yes, 0 for no.\n";<br />
		       (cin>>x).get(); <br />
<br />
			}<br />
			if (x==0)  isfinished=true;<br />
	}<br />
<br />
	return 0;<br />
}<br />


Big Grin | :-D

"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson


GeneralRe: !strcmp Pin
Tibor Blazko13-Jul-03 20:03
Tibor Blazko13-Jul-03 20:03 
GeneralRe: !strcmp Pin
Xander8013-Jul-03 20:10
Xander8013-Jul-03 20:10 
GeneralRe: !strcmp Pin
DaveE9th13-Jul-03 21:04
DaveE9th13-Jul-03 21:04 
GeneralRe: !strcmp Pin
Xander8013-Jul-03 21:35
Xander8013-Jul-03 21:35 
GeneralRe: !strcmp Pin
DaveE9th13-Jul-03 21:51
DaveE9th13-Jul-03 21:51 
GeneralRe: !strcmp Pin
Xander8013-Jul-03 22:54
Xander8013-Jul-03 22:54 
GeneralRe: !strcmp Pin
Ryan Binns13-Jul-03 23:13
Ryan Binns13-Jul-03 23:13 
GeneralRe: !strcmp Pin
Rob Caldecott13-Jul-03 23:17
Rob Caldecott13-Jul-03 23:17 
GeneralRe: !strcmp Pin
Ryan Binns13-Jul-03 23:22
Ryan Binns13-Jul-03 23:22 
GeneralRe: !strcmp Pin
DaveE9th13-Jul-03 23:29
DaveE9th13-Jul-03 23:29 
GeneralRe: !strcmp Pin
Ian Darling13-Jul-03 23:33
Ian Darling13-Jul-03 23:33 
Generalget mouse coordinate Pin
henli13-Jul-03 18:36
henli13-Jul-03 18:36 
GeneralRe: get mouse coordinate Pin
Nick Parker13-Jul-03 19:13
protectorNick Parker13-Jul-03 19:13 
GeneralRe: get mouse coordinate Pin
Ryan Binns13-Jul-03 22:53
Ryan Binns13-Jul-03 22:53 
Questionhow can i add toolbar to activex control?? Pin
logologologo13-Jul-03 16:48
logologologo13-Jul-03 16:48 
Generala vary hard question ---about using OpenDriver() Pin
gdzfy13-Jul-03 16:09
gdzfy13-Jul-03 16:09 
Questionwhat is the different between the the framewrok of the DLL and appliacation in vc++ Pin
gdzfy13-Jul-03 14:54
gdzfy13-Jul-03 14:54 

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.