myfunc(arg) {
if (true) {
// do something;
} else {
// do something else;
};
}
is more compact thanmyfunc(arg)
{
if (true)
{
// do something;
}
else
{
// do something else;
};
}
but that just a personal preferences.let me see. wrong indentation, unneccessary spacing. comments can be improved, by explaining what each function do. that the errors/improvement i think. i like the way you bracket each function though (bracket on the right of function name instead of at the bottom), make the code more compact.
Code: [Select]
myfunc(arg) {
if (true) {
// do something;
} else {
// do something else;
};
}
is more compact than
Code: [Select]
myfunc(arg)
{
if (true)
{
// do something;
}
else
{
// do something else;
};
}
but that just a personal preferences.
You don't need a semicolon after the closing bracketwont hurt. just for uniformity (wasting a byte though) a good compiler will treat it as blank space. the penalty for missing one ; is an annoying compiler error message. i never got one for extra ;, did this from eternity.
Please not. Last time you blasted your homework code over multiple sites, including eevblog and avrfreaks. This time again http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=963433 (http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=963433)
Really, what is wrong in doing your own homework? And what is wrong with at least following the basic suggestions you got last time, like properly formating your code? Why do you come here again if you didn't listen the last time?
I have modified my post and would like to say that I am grossly confused and utterly shocked at the attitude you are showingand you dont grossly shocked by the attitude right inside of you ;) you dont even care to reply in earlier thread.
Thirdly I apologize because I did not go through my last post here. And the message in my inbox said my post was deleted. I do not know if there is any way to retrieve any message that has already been deleted.
I have modified my post and would like to say that I am grossly confused and utterly shocked at the attitude you are showing