Thread: hello

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    26

    hello

    hello i am new to c programming and all ive ever done in the way of programming is html and darkbasic.

    if anyone give me some tips/pointers on c it would be much appreiciated.

    thank you

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Try reading the tutorial at www.cprogramming.com.

    --
    Mats

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    26

    by the way

    i will probably try to make a text based fighty thing like i made with darkbasic where there are combat multiplyers and stuff as a first thing to work towards - any tips. i know your gonna say "start simple" but this is quite simple to do ive done it before.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm not sure what you are asking for - tips like "use paranhesis and braces"? or tips like "you may need a function that looks like this <insert 20-100 lines of code>"?

    One tip I have is: When writing conditional code, write it "constant first", because then you don't get into trouble with mixing single equal signs (assign value) with double equal signs (test for equality). E.g.
    Code:
      ...
      if ( 7 == magic_number ) ...
      ...
    If you happen to miss the double equal in the above statement, the compiler complains. If you turn the 7 and magic_number around, then the compiler will happily assign 7 to magic_number, and continue inside the if, because 7 is non-zero so represents "true" in C.

    --
    Mats

  5. #5
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Variations of BASIC and C may seem similar, but once you start noticing differences you'll find out that C is a lot harder to get things done with, although the power you have with the language is far greater.

    So just like you know people will say "start simple", that's what you should do. Start simple.

  6. #6
    Registered User
    Join Date
    Sep 2007
    Posts
    26
    thanks for the help ive done a few tutorials and am writing a program where you attack and it makes a number from 20 to 30 to take health off (i wanted to put what ive learnt into something) not saying im not having issues - cos i am. but again thanks for the help. and i have realised the differences but the structure is similar to that of basic.

Popular pages Recent additions subscribe to a feed