17
:razz:
"If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?"
-Steven Wright

20
Roanoke wrote:
Robo wrote:He'd never attend a gathering if I came along. He has a phobia of me, as does Bev.
maybe it's the pork scratchings and Boddies bitter..... :badgrin:
Jesus those scratchings are horrible.
Ninety-nine percent of women kiss with their eyes closed; which is why it's so difficult to identify a rapist.

21
Taristin wrote:Wait... why are we picking on Greg?
Who's Greg?
"If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?"
-Steven Wright

24
Greg = Grug...?
"If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?"
-Steven Wright

29
that won't compile in C++, you'd need two =='s so there!
"If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?"
-Steven Wright

30

Code: Select all

#include <iostream>
using namespace std;

int main(){

	if(a = b)
		cout << "a = b";
	else
		cout << "a != b?";
	return 0;
}
1>------ Build started: Project: board101306, Configuration: Debug Win32 ------
1>Compiling...
1>random.cpp
1>c:\comp128\board101306\random.cpp(6) : error C2065: 'a' : undeclared identifier
1>c:\comp128\board101306\random.cpp(6) : error C2065: 'b' : undeclared identifier
1>Build log was saved at "file://c:\Comp128\board101306\Debug\BuildLog.htm"
1>board101306 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So if i were to declare the variables...

Code: Select all

#include <iostream>
using namespace std;

int main(){
	int a, b;
	if(a = b)
		cout << "a = b";
	else
		cout << "a != b?";
	return 0;
}

It does in fact compile

1>------ Build started: Project: board101306, Configuration: Debug Win32 ------
1>Compiling...
1>random.cpp
1>c:\comp128\board101306\random.cpp(6) : warning C4700: uninitialized local variable 'b' used
1>Linking...
1>Embedding manifest...
1>Build log was saved at "file://c:\Comp128\board101306\Debug\BuildLog.htm"
1>board101306 - 0 error(s), 1 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

however...



it will give a debug error on launch, but returns true despite.
Post Reply

Return to “General Discussion”