Change:
void simpleFunc (void);
{
cout <<"We are inside simple func"<<endl;
}
to
void simpleFunc (void)
{
cout <<"We are inside simple func"<<endl;
}
well i was following this tut and did it the exact same way but its not compiling
PHP Code:
#include <iostream>
using namespace std;
void printString(void);
void simpleFunc (void);
void main()
{
cout <<"Before Function Call"<<endl;
printString();
cout <<"After Function Call"<<endl;
}
void simpleFunc (void);
{
cout <<"We are inside simple func"<<endl;
}
void printString(void)
{
cout <<"In Function Call"<<endl;
cout<<"Hello World"<<endl;
simpleFunc();
}
thanks for the helpPHP Code:
error
c:\documents and settings\pc\desktop\p2vid\functions2\functions2\fun2.cpp(14) : errorC2447: '{' : missing function header (old-style formal list?)
Change:
void simpleFunc (void);
{
cout <<"We are inside simple func"<<endl;
}
to
void simpleFunc (void)
{
cout <<"We are inside simple func"<<endl;
}
i have the same problem with this one here
PHP Code:
#include <iostream>
using namespace std;
void printString(char *str);
int stringlength(char *str);
void main()
{
int strlen = stringlength ("Dan");
cout<< strlen<<endl;
}
int stringlength(char *str);
{
int length =0;
while (str[length] != '/0')/*!=doesnt= to know character 0*/
lenght++;/*movin to next char in string*/
return length;
}
void printString(char *str)
{
cout<<"Hello"<< str <<endl;
}
You need to remove the ; at the end of
int stringlength(char *str);
so it becomes
int stringlength(char *str)
(Not from the top declaration part, but from the actual function in the middle if your code)
--DeNitro
void simpleFunc (void); is a function declaration.
void simpleFunc (void) is the start of a function definition.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks