whot the hell is wrong with this script (C++)!?!?!?!

taicoown

Beta member
Messages
2
Whot is wrong with this script in C++? The error in the compiler is:
error befor '['


The code:


#include <stdio.h>

#include <dos.h>

#include <dir.h>

#include <iostream>

#include <fstream.h>

#include <stdlib.h>

void main(void)

{

char drive [_MAX_DRIVE];

char directory [_MAX_DIR];

char fname [_MAX_FNAME];

char extn [_MAX_EXT];

ofstream outputFile;

const char [100000]

outputFile.open << drive << "//hello.bat" endl;

outputFile << "PAUSE" << endl;

outputFile.close();

return 0;

}





test
 
main should return a int shouldnt it?

"void main" would be better off being "int main" me thinks.
 
first problem:
void main(void) should be:
int main()
next problem:
const char[100000]; //<--; was missing
^--you also might need a variable there...
ie
const char buffer[100000];
yes thats it if it says error before '['
that means ur missing a variable

-nickbird
 
Back
Top Bottom