PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Computer Folklore     

CSE 143 and professor Kelsey both give me points off for using Loop


VPN Service Provider

Microsoft wants C++ to replace C, which is fine with me. 14061
In comp.os.linux.advocacy, JeffRelf wrote on 07 Apr 2005 03:20:38 GMT Like this? int main() { return 0; } Or like this...

Hi Kelsey, Re: int main() { printf( "Hello, world-n" ); return 0; }

That's a compiler error... Quickly resolved. Also, should be: main() { printf( "Hello, world-n" ); }

if ( ptr = (char *)malloc(100 ) ) free( ptr );

You, being the poster boy for anal retentiveness that you are, would like to see a sizeof char inside the malloc(). Should be: main() { } because the result is the same.

Re: int main() { return 1; }

Here, you want to see a zero instead of a one. Me, I want to see: main() { } because, again, the result is the same.

CSE 143 and professor Kelsey both give me points off for using Loop. 14059
Hi Spooky ( and professor Kelsey ), Re: Me getting points off for using Loop() in CSE 143, Because they, like professor Kelsey and you, can't recognize fine code when they see it, no doubt. int main...

Re: int main() { double * p ; p = malloc( 100 * sizeof ( char ) ); if ( p ) free( p ); return 0 ; }

Here, you want to see a sizeof double, You also want to check for the error conditon. Me, I want: main() { } because, once again, the result is the same. Also, free( P = 0 ) is fine, no need for the if ( P )

CSE 143 and professor Kelsey both give me points off for using Loop. 14057
In comp.os.linux.advocacy, JeffRelf wrote on 01 Apr 2005 11:40:24 GMT Not quite, Mr. Non-Standard Man. BTW...are you *sure* it's stdio.h? Might...

Re: main( int argc, char ** argv, char ** envp ) { int i; for ( i = 0 ; envp i ; i ++ ) puts( envp i ); }

Better to write to Foo.TXT, like this: main( int argc, char ** argv, char ** envp ) { FILE * fp = fopen("Foo.TXT","w"); if ( envp -- ) while ( * ++ envp ) fprintf( fp, "%s-n", * envp ); fclose( fp ); }

Re: main() { char s 32 ; printf( "Input a string: " ); sscanf( "%s", & s ); printf( "Your string was: %s-n", s ); }

Using a console like that is a bad idea, I'd Never do that. Instead I'd pbutt the string via the command-line ( or use a dialog box ). Like this: main( int argc, char ** argv ) { FILE * fp = fopen("Foo.TXT","w"); if ( argc != 2 ! * * -- argv ) fprintf( fp, "Syntax: Foo.EXE SomeParameter.-n"); else fprintf( fp, "Foo.EXE's Parameter was:-n %s-n", * argv ); fclose( fp ); }

Re: main() { int x = rand(); externfunc( x );

I never use butterts(), better to use Visualstudio's debugger. I never use rand() either, I have my own routines for that, ( I use RandMask instead of RANDMAX because I hate all caps ) RandMask is defined here:

int main() { int x = 3, y = 4; if ( min( x, y ) == x ) puts( "X is less" ); if ( min( x++, y++ ) == y ) puts( "y++ is less" );

CSE 143 and professor Kelsey both give me points off for using Loop. 14058
snips On Mon, 04 Apr 2005 21:00:02 +0000, The Ghost In The Machine Not if you're writing C or C++; it would be...

Should be a .CPP file, like this: int main( int argc, char ** argv ) { FILE * fp = fopen("XY.TXT","w"); if ( argc != 3 ) { fprintf( fp, "Example syntax: XY.EXE 3 4n"); fclose( fp ); return -1 ; } int X = atoi ( * ++ argv ), Y = atoi ( * ++ argv ); if ( er( X, Y ) == X ) fprintf( fp, " X is smaller.-n" ); if ( er( X ++, Y ++ ) == Y - 1 ) fprintf( fp, " Y is smaller.-n" ); if ( er( -- X, -- Y ) == X ) fprintf( fp, " X is still smaller.-n" );

True, I haven't had so much fun since I last tutored CSE 142 and 143. That was riot... got points off from professor Kelsey for using Loop().


Linux | Previous | Next

CSE 143 and professor Kelsey both give me points off for using Loop. 14057

Linux Advocacy Newsgroups

What is it's scope