PDA

Click to See Complete Forum and Search --> : <>


SteveCRM
Dec 14th, 2000, 08:37 PM
what is not equal to in C++? sorry I don't have any help files...for C++ or vb :)

dangr
Dec 14th, 2000, 08:56 PM
!=

Sam Finch
Dec 14th, 2000, 08:58 PM
!=

be careful with = as well,

if (a = b)


is equivilant to

a = b;
if (a)


because a single equals in C++ means assign, and it returns the vlue they're both equal to, use

if (a == b)


you probably knew that but I thought I'd mention it in case you didn't.

SteveCRM
Dec 14th, 2000, 09:40 PM
for some reason I get an error with !=

that what I have been using but its not working

btw its VB++ 6

thanks sam ;)

rekcus
Dec 15th, 2000, 02:19 AM
What's VB++6?

!= should be correct. Maybe you can post your code
for us to look it over.

Dec 15th, 2000, 07:07 AM
#include <iostream.h>

int main()
{

int a = 1;
int b = 2;

if (a != b) cout << "not equal";

return 0;
}


try that..

it works for me :)

SteveCRM
Dec 15th, 2000, 02:59 PM
Sorry I meant VC++6 not VB++6 :rolleyes: