Forum Update - Announcement about May 10th, 2018 update and your password.

Function help

I am trying to display the values of startVal, endVal and incVal, and have the for statement start at 10 and multiply until it reaches 100. I get an error message like this Function with Parameter (1).c:26:2: error: expected identifier or '(' before '{' token
Done. Build Failed!
Can I have some insight into what I am doing wrong? Thanks y'all.

Click error or warning messages above to debug.
#include "simpletools.h" // Include simpletools


void counter(int startVal, int endVal, int incVal); // Function prototype

int main() // main function
{
counter(6, 100, 1 * 2); // Call value function
}

void counter(int startVal, int endVal, int incVal) // value function

{
print("The value is: startVal = %d\n", startVal); // Display a single value
print("The value is: endVal = %d\n", endVal); // Display a single value
print("The value is: incVal = %d\n", incVal); // Display a single value
}
{
for(int i = startVal;... i = endval;... i = incVal)
{
print("i = %d\n", i);
}
}

Comments

Sign In or Register to comment.