PDA

View Full Version : A little experiment


Dalp
04-23-2002, 11:21 PM
What would you guys think about teaching someone C, C++, or C# from scratch through the forums? I'm a techy-teenager with a lot of time on my hands and am very willing and able to learn. Tell me what you think.

Strike
04-24-2002, 03:04 AM
well, www.codeexamples.org is a good start - really you just gotta code, code, code until it starts to click. Of course, reading about it and learning which practices to follow and which to ignore is also good (necessary!) as well, but the bottom line is that you can't even become a bad coder without sitting down and just coding :)

kmj
04-24-2002, 09:05 AM
I have no problem answering your questions, and I can happily provide with a number of little assignments to give you practice.

I don't know C#, but C and C++ I know just fine. I think to keep it simple, you should stick with one until you're comfortable with the basic concepts of programming.

Before we even try to start, though, we need a little info: What type of system are you on? (windows, mac, linux, etc). Do you already have a compiler? Do you know what a compiler is? (c:

Strike is right that it will require a good deal of effort on your part, and you'll need to code alot to become a good coder (duh (c:). It's not hard, but you need to have patience in the beginning. A number of people don't make it because their programs have silly little errors and they just get too frustrated trying to get rid of them all, but if you stick with it, it gets easier and easier.

Dalp
04-24-2002, 03:41 PM
FYI:
I'm mainly running on Windows, but i also have a mac and will soon have my linux box up and running. I know that a compiler takes the code and makes it executable but no, I do no have one.

Strike
04-24-2002, 09:18 PM
You can get a free one if you install Cygwin (you get all the Linux tools in a Windows environment).

www.cygwin.com I think

sans-hubris
04-24-2002, 09:45 PM
I tried doing this over at LJR (http://www.linuxjunior.org) without any success. I'd be willing to try it here, though.

Dalp
04-26-2002, 05:40 PM
Could someone post an example of a very basic C++ source code?

kmj
04-26-2002, 06:03 PM
#include <iostream>

using namespace std;

int main()
{
cout << "Hello Coderforums!" << endl;
return 0;
}



the function 'main' is executed when you run the program, 'cout' tells the computer you want to print something, and "Hello Coderforums!" is the string you want to print.

edit: cout is in namespace "std", so I added the "using..." line, and added a newline to ensure the buffer gets flushed. Thanks for the tipoff, vomjom. :)

Lex Luthor
06-21-2002, 07:54 PM
hey, is it just my compiler or don't you have to use getch() to keep the program up without opening a dos shell?

And i know i am probably wrong but shouldn't there it be return(0); instead of return 0; ?

Strike
06-21-2002, 11:10 PM
Originally posted by Lex Luthor
hey, is it just my compiler or don't you have to use getch() to keep the program up without opening a dos shell?

And i know i am probably wrong but shouldn't there it be return(0); instead of return 0; ?
A lot of the people here don't use Windows :) Remember, shells are your friend. Well, not DOS shells.

kmj
06-23-2002, 10:22 PM
Lex: generally, if I run a console program, I open a dos shell first... but otherwise, in windows, yeah, you have to do something along those lines. Also, the parenthesis are optional, unless I've completely gone senile.

LiquidG
06-24-2002, 05:21 PM
New to this forum, and just read this thread and i'm very interested in joining this 'experiment'

Currently, I'm a novice C++/Java coder, but would very much like to learn C (since the majority of the code I sift through is written in it) ...

kmj: if you wouldn't mind, i'd appreciate the assignments you are offering for practice.

kmj
06-24-2002, 06:38 PM
bafalouk: if you're familiar with C++, then C should be very easy for you to pick up.

To start with, why not try to implement GnuVince's boggleboard challenge (http://www.coderforums.net/showthread.php?s=&threadid=603).

This should be a relatively simple program to do in C. If you think it's a bit too much, or you need a little more help getting started, just ask.