1. This forum is in read-only mode.

The RomU C Tutorial.

Discussion in 'Computers & Modding' started by fgghjjkll, May 10, 2009.

Thread Status:
Not open for further replies.
  1. fgghjjkll

    fgghjjkll Well-Known Member

    ok guys.
    umm....so some of you want to code for the PC or DS or some other crap, and i think C is kinda suitable for it.
    C is kinda like a half/half language. not easy but not hard either.
    so...yeah. anyways. i know im lazy so i might not post everyday. but i WILL post. or some one will anyway. XD
    anyways.

    lets start with the history of C?

    ill make it very short.
    First there was B language. then there was C. then there was C++

    and...yeah....ill post later
     
  2. fgghjjkll

    fgghjjkll Well-Known Member

    ok guys.
    umm...
    anyways.
    when you code in C. there is going to be some steps.
    1.think up an idea
    2.use notepad [or something similar]
    3compile and link
    4.test.
    5.debug

    anyways.
    lets code a simple thing. but before i do that.
    C is like give and get.
    you enter some thing, it spits something back.
    this thing is called I/O [or something}
    which ill tell you later in the thread.

    #include <stdio.h>

    int main()
    {
    printf("This is an example!\n");
    return(0);
    }
    #include is known as a preprocessor directive. tells the compiler to include stuff from another file obviously. stdio.h stands for standard input output. this is required by most programs. without it your dead.
    int identifys main as a interger function.
    printf prints stuff on the screen. \n makes new line.
    return(0) clears the memory that this app used. kinda..i think....

    anyways. yeah
    thats you first real lesson.
    did i miss anything?
     
  3. bhatooth

    bhatooth Well-Known Member

    wait what can i do with C?
     
  4. anandjones

    anandjones Well-Known Member

    http://en.wikipedia.org/wiki/C_(programming_language) Usually Medium-High level ranged language. I do not see the point in this. There are many in-depth tutorials on the web written by actual programmers :p
     
  5. Loonylion

    Loonylion Administrator Staff Member

    Windows is most likely written in C. Most big programs are.
     
  6. Lechongbaboy

    Lechongbaboy Well-Known Member

    May I ask what's the difference beetwen C, Turbo C, C++, C sharp? I once got into College as an IT student and am baffled by it.
     
  7. Loonylion

    Loonylion Administrator Staff Member

    C is a language, turbo C is an IDE (integrated development environment) for the C language, C++ is a language derived from C and C sharp is an entirely different language

    this tutorial misses so much important stuff its really not a good idea to follow it.
     
  8. fgghjjkll

    fgghjjkll Well-Known Member

    ok...umm....

    youll be learning bout puts.

    so...itll be like this....

    #include <stdio.h>

    int main()
    {

    puts("Example....lol");
    return(0);
    }

    basically you pronounce it as put string,
    when using puts, remember that its almost like
    printf("Example...lol\n");

    so if you dont want a new line, use printf.

    [if someone thinks that this is a waste of time, ill ask a mod to lock it up.
    the reason im teachin you guys is cos you dont have to spend months at uni studying C and also it saves you time from googling a tutorial, cos it RIGHT IN FRONT OF YOU!]
     
  9. marcy

    marcy Guest

    How about structuring your programs a little

    like this ->

    #include <stdio.h>

    int main ()
    {
    printf ("Hello World!\n");
    return 0;
    }


    Or/And you could use the code-tag to seperate the source code from your explanations :) ->

    Code:
    #include <stdio.h>
    
      int main ()
      {
        printf ("Hello World!\n");
        return 0;
      }
    

    I personally like the idea of this thread. :)
     
  10. Loonylion

    Loonylion Administrator Staff Member

    They'll waste more time trying to learn from this than they would googling a proper tutorial. You are not explaining anything, and you are missing out a lot of important stuff regarding program structure and good practise. At this point, I could write a better tutorial and I barely know any C
     
  11. jevejo777

    jevejo777 Well-Known Member

    you're totally right, but it could be useful if this is for asking something about c you don't get so someone can explain it.
     
  12. Seph

    Seph Administrator Staff Member

    Asking yes, tutorial no.

    Besides C is a pain, go with C++. :p
     
  13. fgghjjkll

    fgghjjkll Well-Known Member

    oh well....meh...
    anyway...im gonna type more up later...too lazy right now XD
     
  14. marcy

    marcy Guest

    The lord has spoken :D
     
  15. 1prinnydood

    1prinnydood Guest

    You guys are all nuts, all the best programers use LOLCODE, feast your eyes on the glory :p

    HAI
    CAN HAS STDIO?
    I HAS A VAR
    GIMMEH VAR
    IZ VAR BIGGER THAN 10?
    YARLY
    BTW this is true
    VISIBLE "BIG NUMBER!"
    NOWAI
    BTW this is false
    VISIBLE "LITTLE NUMBER!"
    KTHX
    KTHXBYE

    For more sillyness http://lolcode.com/ (sorry for being off topic, I could not resist) :D
     
  16. Loonylion

    Loonylion Administrator Staff Member

    Thats bollocks, REAL programmers use brainfuck.

    Code:
    ++++++++++        initializes cell zero to 10
    [
       >+++++++>++++++++++>+++>+<<<<-
    ]                 this loop sets the next four cells to 70/100/30/10 
    >++.              print   'H'
    >+.               print   'e'
    +++++++.                  'l'
    .                         'l'
    +++.                      'o'
    >++.                      space
    <<+++++++++++++++.        'W'
    >.                        'o'
    +++.                      'r'
    ------.                   'l'
    --------.                 'd'
    >+.                       '!'
    >.                        newline
    
     
  17. 1prinnydood

    1prinnydood Guest

    Loonylion, all lies, the best real programmers use Piet.

    Prime Number Generator
    [​IMG]

    http://www.dangermouse.net/esoteric/piet.html

    (I promise no more off topic spam)
     
  18. nomercy

    nomercy Well-Known Member

    Don't start with C++ if you don't know C. C++ is an extension to C, so it makes sense to first learn C and then C++. You'll hate programming if you start with C++.

    C is low-level, when you want to do things fast and efficient. If C is still too slow, then you'll end up with assembly, which is not portable.

    C# is .Net based and is more like Java than C (although it feels so much faster than Java).

    If you spend months learning C at uni, then you have a strange university. C is a tool, not a goal. I had three lectures in C, of which two were explaining the whole pointer thing (including how memory works).

    Don't bother with a tutorial, you'll miss out on the basics.
     
  19. CloudBoii12

    CloudBoii12 Well-Known Member

    ...
    this
    is going nowhere? LOL
     
  20. anandjones

    anandjones Well-Known Member

    nomercy not necessarily. You will get stuck on C for a while if you learn that first and then switch to C++, the reason being similar to the "bad habits are hard to break" deal. You'll get used to using different aspects in one language, which then would usually result in errors on the other source when it comes to it (.c,.cpp etc.). I wouldn't call it an 'extension' either. And yes, C++ would be worse in terms of speed and size (binary execution, compiling etc.). Also, C++ has OOP :p And classes.

    Brainfuck is the shit :p
     
Thread Status:
Not open for further replies.