Ooooooooh *facepalm* my god, how did I do that...
Thank you!
One more quick question, lets say for that print feature, I need to print out a "[" before element one, a comma between each element, and a "]" after the final element, how would I go about doing this?
I tried this:
1 2 3 4 5 6 7 8 9
|
void print_array_dbl(double Array[], int C) {
printf("[ ");
int i = 0;
for(i; i < C+1; ++i) {
printf("%lf", Array[i]);
printf(", ");
}
printf(" ] \n");
}
| |
but that gives me errors... quite a few actually. Like:
"missing ";" before type"
"i": undeclared identifier"
"i":undeclared identifier"
I'm used to using cout (C++), not printf, so can anyone explain what's so wrong about this?
for example, in C++, out could just say cout << "blah blah text " << value << "more text. \n", and it would work fine...