Got some problem with arrays!!!
hello guys can you help me out with this problem i mean why cant i use the function par in cout command????
using namespace std;
void par(int ar,int lgt)
cout<<"haha atlast it happened"<<par(n,4);
You're attempting to print out a void
function, which is only going to give you an error.
Cout will print values, but will not call your functions for you. Par needs to be called on a separate line by itself:
cout<<"haha atlast it happened";
par(n,4); //call function
another note, C++11 make the '=' arbitrary for array brace initialization so you are able to leave that out.
Last edited on
Topic archived. No new replies allowed.