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

C trouble

Name: C_expert 2007-08-23 6:45 ID:994U8aXD

Hey fellas.

I can't work out why this code i've been writing doesn't work:
its a calculator ;)

#include <stdio.h>

int main(int argc, char * argv)
  {
  int myint = 2;
  int myint2 = 3;
  int result;
  myint + myint2 = result;
  printf("%d", result)
  }

is it because of the FORCED INDENTATION OF CODE lol?
 

 

Name: Anonymous 2007-08-23 9:59 ID:VKYGX1f2

>>6
That's retarded. Exactly equivalent to going

def whatever(param1):
    print "hey, the parameter is %d!" % (param1);
    if param1 == 66: return 42;
    else: return param1+1;


Stick with the usual conventions or GTFO. With C, C++, Java etc this means the One True Brace Style, or again GTFO.

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