• entries
17
9
• views
12266

# New semester

323 views

I'm in the second week of the spring semester. I am taking an Embedded control class right now. We are using C cmpiled for the C8051 microprocessor. Our lab manuals examples of code are absoultely attrocious. It has a chapter introducing C. This is the first program:

#include  /* include file header*//* begin program here */main(){ /* begin code block here */    printf("Hello World!\n");        /*Output text to console */}       /* end code block

I realize the assumed "void" on main is legal in C, but isn't it still considered bad practice? Every comment in the code uses the multiline comment no matter how many lines. The manual specifically says not to use // comments because they can cause strange errors... I would think /**/ comments are worse, since many students will be tempted to nest them and such.

Anyway, the class still looks fun. We are writing code for a "smart car" to follow a white line, as well as a self-controlled blimp.

I haven't done much with the Scene graph engine lately. I keep thinking of new ways to implement it. I think I will just go for a nice easy, unoptimized approach and just try to finish it for now. If I have time, I can always clean it up and rewrite portions.

I did manage to fix the memory leak. It was aparently due to a bad copy/paste job on my part. I was actaullty making two copies of each texture thsat I loaded,but only deleting one of the pointers. It was an easy fix, just delete the offending line...

I agree. That code hurts my eyes!

Your avatar shows that you are still recovering from the effects of New Year's.

If I recall my standards properly, single line comments (// comments) weren't legal in C until C99, which is why /**/ comments are the norm for C code.

Quote:
 Your avatar shows that you are still recovering from the effects of New Year's.

Unfortunately I went home for the break and was stuck with my parents, so no new years fun for me...

Quote:
 If I recall my standards properly, single line comments (// comments) weren't legal in C until C99, which is why /**/ comments are the norm for C code.

Hm... I've never heard that before. I know that the single line comments work fine in the compiler we are using. The instructor has definately been doing this for a while though.

## Create an account

Register a new account

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.