Skip to content

Function Calls

In C/C++, functions and procedures are the equivalent of methods in C#. They are functional units, things we can call on to achieve a task.

Example

The code below matches the previous example for calling methods in SplashKit. Notice that there are no changes in logic. As we are using the same library, we can call the same function calls, in the same order. Just the identifiers for those functions have changed.

#include "splashkit.h"
int main()
{
open_window("Random Color", 800, 600);
clear_screen(random_color());
refresh_screen();
delay(1000 * rnd(10));
}