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

Pages: 1-

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 6:50 ID:Heaven

>>1
No, it's because you're stupid. :(

Name: Anonymous 2007-08-23 6:51 ID:Heaven


result = myint;
result =+ myint2;

ANCIENT C JUST KICKED IN YO

you're clearly a troll, it's easy to tell because you defined argv as type of char* (as opposed to char *argv[] or char **argv)

Name: Anonymous 2007-08-23 6:55 ID:994U8aXD

yeh. OP here. its a troll. I was hoping for more furious reactions

Name: Anonymous 2007-08-23 7:53 ID:F7zVwcU5

>>1
GNU FAG BRACES
You need to spend 5 years with the forced indentation of code so you learn to indent properly.

Name: Anonymous 2007-08-23 8:04 ID:Heaven

>>5
Well, >>1 indented just like in Python ;)  Thread over.

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.

Name: Anonymous 2007-08-23 10:12 ID:ct/gVeuf

>>7

One True Brace Style is ugly and retarded. Just like you.

K&R/Kernel style or GTFO

Name: Anonymous 2007-08-23 19:17 ID:Wtu9eGWz

K&R or faggot

Name: Anonymous 2009-03-06 6:13

code is code that   I could base   my design around   wouldbe more fitting.

Name: Anonymous 2009-05-21 8:31

aasadfasdfgghhasdf

Name: Anonymous 2011-02-03 2:09

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