I was looking through the example C source code in the CE Developer kit, and noticed that while function prototypes were normally used, occasionally an entire function would be declared before the main loop. How do you know when a function prototype needs to be used or not?
Here is the example where a prototype was not used.
Code:
Thank you
Here is the example where a prototype was not used.
Code:
/* Function for drawing the main sprite */
void draw_sprite(int x, int y) {
/* Fill the screen with color index 0
/* Note that this is a super inefficient way to
/* redraw, but it demonstrates a simple way of clearing past data */
gfx_FillScreen(0);
/* Draw a bunch of different styled sprites on the screen */
gfx_Sprite(ubuntu, x, y);
/* Copy the buffer to the screen */
gfx_BlitBuffer(); // This is the same as gfx_Blit(gfx_buffer)
}
void main(void) {
bool right;
bool left;
bool up;
bool down;
kb_key_t arrows;
...
Thank you