Saxon's 48 hour programing Challenge.

Saxon

New Member
#1
Saxon's 48 hour programing Challenge.

Ok ladies an gentlemen, this is my 48 hour programing Challenge, in the next 48 hours commencing at 6pm GMT only taking time off to sleep an work I will teach myself how to program in C with the end result being a short program (undecided yet as to what it will be) this will allow me to learn something I have been wanting to do for along time an will help boost my skill set.

Wish me luck an pray i don't go mad. :??

 

mqudsi

Mostly Harmless
Staff member
#2
Good luck, Saxon! :smile:
 

Mak 2.0

Mod...WAFFLES!?!?
Staff member
#3
Good Luck. Don't go mad.
 

Saxon

New Member
#4
It has begun.

Addendum:

OK first hurdle I have wrote the following:
Code:
/* this is a test */
#include <stdlib.h>
#include <stdio.h>

void main()
{
printf ("this my first program.\n");
exit(0);
}
An in line 6 my compiler (Dev-C++ 4.9.9.2) is telling me `main' must return `int' I have gone through the code an I can't see anything wrong, it might just be a rookie mistake but can some one help me with it?
 
Last edited:

mqudsi

Mostly Harmless
Staff member
#5
Not
Code:
exit(0);
but
Code:
return 0;
 

mqudsi

Mostly Harmless
Staff member
#7
Oops.

You have void main().

Code:
int main() 
{
//do something.
return 0;
}
 

Saxon

New Member
#8
That code let me compile it but closed the window to quick to let me see what is on the screen, oh an thanks for the help CG.
 

mqudsi

Mostly Harmless
Staff member
#9
Add this to the end of the program:
Code:
int a = 0;
cin >> a;
That'll make it wait before closing.

Addendum:

Oh, and I should mention, going mad is 90% of being a real coder.
 
Last edited:
#10
I will give that a try then, I am looking forward to learning programing properly.

Addendum:

OK it works now! but i am still a little ignorant on why your tweaks worked an mine did not can you give me a rundown on what yours did that mine didn't? an why? that is if you have the time guru.
 
Last edited:

mqudsi

Mostly Harmless
Staff member
#11
Windows searches for a function that returns an int and is called main. If it's not there some compilers won't accept it as valid code because it may not run.

Anyway, how did your 48 hours go?
 
#12
Still going on I am counting hours I worked on the challenge not total time - I have to work an sleep some time.
 

Terry60

Knows where his towel is.
Staff member
#13
Ah ! A clever change in the ground rules Saxon. This 48 hours could still be going next month then ?
 

JustinW

Super Moderator
Staff member
#15
ROFL !! I was waiting for a thread like this... don't go too mad now!!

I'm going mad learning to program myself. What are you using to program/compile the code? I'm starting with VB. C looks to cryptic for a beginner's language.
 

JustinW

Super Moderator
Staff member
#17
I know... I've tried a lot of free compilers/developer tools myself. A lot of the time there was so much involved with actually setting up the tools needed to build projects from the source code.

If you haven't heard of it already, Microsoft offers free (Express) versions of the Visaul Studio IDE that have all the basics the paid versions have that you can download. All you need to do to use them is register with a new or existing Passport. That is, if you want to go down the Microsoft developer route :smile:. MSDN (Microsoft Developer Network) also has a beginner developer learning center with short articles and videos to get you started.

I am using VS 2008 Pro myself, but I've tried the 2005 Express Editions before and they are pretty good considering how they are free. You can get language specific editions or the entire suite :smile:.
 
Last edited:

mqudsi

Mostly Harmless
Staff member
#18
Actually, you can even get the 2008 Express Editions as well now, they're pretty good.

For C++, I don't recommend anything other than VC++ (Express or otherwise) and NetBeans 6.1 (if you're looking for free and non-Windows).
 

Mak 2.0

Mod...WAFFLES!?!?
Staff member
#20