Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

some C++ question

Name: that nigger 2009-04-02 2:29

so /prog/rammers can you tell me why this only returns
x=1 y=1
I'm trying to have it return the values that equal 133745639

heres the code:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
unsigned long int x = 1;
unsigned long int y = 1;
unsigned long int z;


while ( z != 133745639)
{
z = x * y ;

if ( z = 133745639 )
{
cout << "x=" << x << "y=" << y << endl;
}
else
x++;
}
system("PAUSE");
return 0;

}

Name: Anonymous 2009-04-02 20:10

>>25
It's a pointer, bro. Are you going to object to every standard idiom in the book? The alternative is:
a_oo = find_foo();
if (a_foo != NULL) work_on(a_foo));

Way clearer, bro. Not.

>>27
The trouble with forcing utf8 is that some highly popular operating systems are fairly stupid regarding character encoding. You'd first have to make sure that the editors in question will reliably save utf8 text without requiring the developer to jump through hoops first, because to do otherwise would be to shoot yourself in the foot. A language whose syntax makes the normal development workflow more difficult is destined to fail. Take a history lesson from APL, lest you repeat its mistakes.
It's 2009, and Unicode adoption is way up. It's not 100% yet, but it's not going to get that way unless we continue to push. Writing a compiler or editor, in 2009, that doesn't support UTF-8 is a laughable proposition.

APL was a different situation entirely: there was no Unicode at the time, it had way more strange symbols to know/type, and its syntax was pretty wonky too. Its ASCII descendents haven't exactly caught on either, which should tell you something about how appealing APL syntax is to the average programmer.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List