I'm not sure 100% if this would work (or if it's what you want)
CODE
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 256
int main main(int argc,char *argv[]) {
int noofstudent=0;
if(argc > 1) {
noofstudent=argv[1];
}
return 0;
}
Depending on what the variable noofstudent is going to referance, it doesn't sound to me like it
should be an array. But you'll need to explain more on what you are trying to accomplish.
Maybe you want to setup a struct, defined with a max of noofstudent variable that was input. Then you could use the struct to contain multiple variables of different variable types. Age (int), sex(char), grade (char or int), class (char)... etc.
QUOTE
CODE
void main;
{
int noofstudent[999]
Fyi, this contains a few errors that will halt your program from the get-go.
1.) main should be an int return type
2.) the ; after declaring main, will halt the program.
3.) you need to have parens () after main for any input type sent to main. If none, then use void.
4.) you are missing ; after your int. ; is needed at the end of any single statement.