News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Hi Bit heads

Started by Danielm103, November 19, 2006, 11:53:23 PM

Previous topic - Next topic

Danielm103

Hi everyone, I am new here and I am new to C. I know a little C# but I am here because I want to learn all the C's - C, C++ and C#.  My first programming languages where Lisp and C# which was great to start off with but I feel I want to get closer to the machine.

Thanks Pelle for setting this all up!

Dan

P.S.
It seems this board needs to cleaned up a little  :cry:

Greg

Hi Dan,

Pelle has been conspicuously absent from here for several weeks now, I hope he's OK.

Anyway, you picked a great C compiler to learn C with. There are some good C programmers that hang around here too.

Cheers,

Danielm103

Hi Greg,

Thanks for the reply, Maybe Pelle is on vacation at some Caribbean island, hanging on the beach drinking margaritas.  8)

Your right, this compiler is awesome. I was just in a challenge over at TheSwam.Org
http://www.theswamp.org/index.php?topic=13609.0
My first C programs performed very well  =D> . I'm really liking the performance that C has to offer. I hope I can be a contributor to this board. I have attached a copy of my first C program (I had help), maybe someone can make it even faster 

Dan

I could not attach the test data as it was too large but you can get it from the swamp if your interested

severach

Both your strings have buffer overflow.
       TallyResult = (char *)malloc(64);
       ToString(TallyResult, 256, result);
       TimeResult = (char *)malloc(64);
       ToSeconds(TimeResult, 256, diff);

If the size is always 64, why not

 char TallyResult[64];
 _snprintf(TallyResult, sizeof(TallyResult), "%f", result);

Danielm103

Severach, Oh now that I see your code, I see the rookie mistake I have made. :oops:
Thank you for taking the time to review my code.