my "hello world" whats wrong
my "hello world" whats wrong
heres my code,
//////////////////////////////////////////////////////////////////////
#include "iostream"
#include "holla.h"
//////////////////////////////////////////////////////////////////////
using namespace std;
int main();
{
cout;"halo2"
return 0;
}
it keeps saying missing function header what do i have to do? MAJOR NOOB!
//////////////////////////////////////////////////////////////////////
#include "iostream"
#include "holla.h"
//////////////////////////////////////////////////////////////////////
using namespace std;
int main();
{
cout;"halo2"
return 0;
}
it keeps saying missing function header what do i have to do? MAJOR NOOB!
Code: Select all
//////////////////////////////////////////////////////////////////////
#include "iostream"
#include "holla.h"
//////////////////////////////////////////////////////////////////////
using namespace std;
int main()
{
cout<<"halo2"
return 0;
}
if you're looking for me, start looking on irc, i'm probably there.
what about the semicolon after main? there shouldn't be one
edit:
@Armen138 damn, you were faster
Code: Select all
int main() <- no semicolon
{
...
}
@Armen138 damn, you were faster
"Guest" was right.
- Myth
Code: Select all
//////////////////////////////////////////////////////////////////////
#include <iostream.h> // I changed it
#include "holla.h"
//////////////////////////////////////////////////////////////////////
// I removed the namespace
int main(void) // Added void, didn't know it was called a semicolon :?
{
cout<<"halo2"; // Here I've added ;
return 0;
}
Shouldn't cout be in namespace std? Thus it should be std::cout or
somewhere before. And don't forget to flush your output stream, e.g. by appending <<std::endl; to really get the output at the place where you want to have it.
Code: Select all
using namespace std;