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 18:39

>>20
I like the arrow operator, except it's nearly impossible to type, not to mention character encoding issues.
Just let your editor replace ``<-'' with ``←'', and UTF-8 it up. IMO, the best thing for character encoding issues is to force Unicode adoption as hard as possible.

<- wouldn't work either, because then you'd have an ambiguity between x < -3 and x <- 3.
But who the heck would type a space in their assignment operator or a space between a number and a negative sign? C's whitespace rules are nuts anyway. They should just standardize on whitespace being required between tokens, with just a couple of exceptions (braces, semicolon).

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