
-----------------------------------
shadowNET
Tue Sep 11, 2012 4:19 pm

Where do i start?
-----------------------------------
I have wanted to start learning to program in C for a while, but i dont know where to begin! :(  i know i need a compiler and an editor like notepad++ but other then notepad++ i dont know where to get this stuff. Also if anyone knows some basic tutorials i can foll ow it would be greatly appriciated. Thanks in advanced! :D

-----------------------------------
Tony
Tue Sep 11, 2012 5:17 pm

RE:Where do i start?
-----------------------------------
C has a fairly steep learning curve. Why did you want to start with C in particular?

-----------------------------------
shadowNET
Tue Sep 11, 2012 6:01 pm

Re: Where do i start?
-----------------------------------
Just somthing basic like a date or clock etc, even the basic "hello world" script would suffice but primarily the tools i will need to compile and edit C code

-----------------------------------
mirhagk
Tue Sep 11, 2012 6:11 pm

RE:Where do i start?
-----------------------------------
Is this your first language?

-----------------------------------
shadowNET
Tue Sep 11, 2012 6:18 pm

Re: Where do i start?
-----------------------------------
Im going to say yes, because the only other language i have done is turing, which honestly doesnt really count for much, although i did do a bit if java a little while ago but nothing major, i wrote a few scripts for a botting program

-----------------------------------
mirhagk
Tue Sep 11, 2012 6:42 pm

RE:Where do i start?
-----------------------------------
Okay well I'd suggest looking into more high level languages like C#, python or even just C++, but if you're dead set on C, probably the best way is to pick up a book on it, or find an online tutorial, they'll explain getting compilers and everything you need.

-----------------------------------
shadowNET
Tue Sep 11, 2012 6:54 pm

Re: Where do i start?
-----------------------------------
alright thanks for the help, ill look into that now  :mrgreen:

-----------------------------------
Insectoid
Tue Sep 11, 2012 7:46 pm

RE:Where do i start?
-----------------------------------
I'd suggest looking into more high level languages like C#, python or even just C++

I would suggest the opposite. C actually isn't a bad choice coming from Turing. Both are procedural languages. You can probably convert most of your (non-graphical) Turing programs to C just by replacing the syntax & function names. You don't have to worry about learning OOP or some other paradigm, but you can when you take on C++ (which you needn't bother with until you've learned enough C).


In my opinion, high-level languages suck all the fun out of programming. If you just want the final product, by all means learn C#. But if you'd rather write a program than use it, C/C++ will serve you well.

-----------------------------------
mirhagk
Tue Sep 11, 2012 8:34 pm

RE:Where do i start?
-----------------------------------
the biggest differences between C and C# are essentially how much you have to worry about the basics, how easy libraries are to use, and how much the language offers. I'd say the funnest part of programming is discovering and utilizing new tools, and with a higher level language you get MANY more tools to learn and use. You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer". Higher level languages take away syntax errors and let you have freedom to program, and then give you amazing tools to use, and you can keep learning new features over and over.

But no I think programming in machine language is probably the most fun because assemblers just sucks all the fun out of programming

-----------------------------------
Insectoid
Tue Sep 11, 2012 10:09 pm

RE:Where do i start?
-----------------------------------
But no I think programming in machine language is probably the most fun because assemblers just sucks all the fun out of programming

I know you were being sarcastic, but assembly is fun. It's just damn hard to write anything significant in it. 

You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer".

I'm sorry, but that statement is absolutely ridiculous and completely untrue.

-----------------------------------
[Gandalf]
Tue Sep 11, 2012 10:47 pm

Re: RE:Where do i start?
-----------------------------------
You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer".

I'm sorry, but that statement is absolutely ridiculous and completely untrue.
It's a valid point: the syntax of C is pretty trivial and easy to master, however it is also much more difficult to learn how to write expressive and bug free C code.  Often times, the examples mirhagk used will be caught on compile time or with static analysis, however that only counts for so much in a language which can be a nightmare to debug.

-----------------------------------
wtd
Tue Sep 11, 2012 11:22 pm

RE:Where do i start?
-----------------------------------
Or we could just give him Hello world!

[code]#include 

int main(int argc, char *argv[])
{
    printf("Hello, world!\n");

    return 0;
}[/code]

For what it's worth, my [url=http://wiki.compsci.ca/index.php?title=Whirlwind_Tour_of_C]Whirlwind Tour of C.

-----------------------------------
Amarylis
Wed Sep 12, 2012 6:26 am

RE:Where do i start?
-----------------------------------
[code]

#include 
using namespace std;

int main(int argc, char *argv[])
{
    cout >> "Hello, World!\n";
    return 0;
}

[/code]

Wouldn't that be the proper C? (I thought stdio was C++ library)

-----------------------------------
Insectoid
Wed Sep 12, 2012 6:59 am

RE:Where do i start?
-----------------------------------
You've got it backwards. iostream, namespaces and cin/out are C++. stdio/printf are C.

-----------------------------------
shadowNET
Wed Sep 12, 2012 4:20 pm

Re: RE:Where do i start?
-----------------------------------
Or we could just give him Hello world!



Yes i think thats a great idea, i think ill settle with C for now thanks for all the replies

-----------------------------------
bl0ckeduser
Wed Sep 12, 2012 11:01 pm

Re: Where do i start?
-----------------------------------
This has already been done many times, but I can recommend the "K&R" book.
Also there is the comp.lang.c newsgroup for advanced pedantic questions
and the ##c channel on freenode.
