So i keep getting an "incomplete type not allowed error" on the emphasized call of function "out" on this and ive switched the function decs around, and i decided to not move on until i have this figured out because i can't find any non-class examples that aren't completely analogically opaque. Noob question but any help would be appreciated.
its supposed to be a simple fibonacci function but obviously i haven't written all the code. Cpp 14 ( on g++, im getting syntax highlights suggesting its 11, however).
#include <string>
#include <iostream>
int fib(int x);
int input();
void out(int p);
int fib(int x) {
// int* prim;
// int* sec;
// *prim = 1;
// *sec = 1;
// int count =
}
int main(){
void out( fib( input() ) ); // error here // out on this line
return 0;
}
int input (){
int inp = 0;
}
void out(int p){
std::cout << "the number is: " << p ;
}
This:
int main(){
void out( fib( input() ) ); // error here
}
is interpreted to something like an instantiation of a variable of type void
calling the constructor that accepts a int
as first parameter,
instead you probably want this:
int main(){
out( fib( input() ) );
}
that is just a function call