SYS_fork

I am having some trouble with the browser-based compiler, codepad and every time I compile a long program, I always end up with an error and a message appears, saying : "SYS_fork". Is this normal, or do I need to download a real compiler that would actually run my code.

Here is my code :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  #include <iostream>
#include <string>
 

using namespace std;

int main() //the main and executable part of the program
  {
    int age;        
  string question;
    
    question = "What is your current age?\n";
   cout << question;   //prints out the question
   
    cin>>age;   //user inputs their age
    
    if(age < 1) {
      cout << "you are less than a year old.\n";
      }
    
   if(age == 1) {
     cout << "you are an infant.\n";
     }
    else if(age > 1 && age <= 5) {
      cout << "you are a toddler.\n";
      }
    else if(age >= 6 && age < 13) {
      cout << "you are just a kid.\n";
      }
    
    else if(age > 12 && age < 20)
      {
      cout << "you are a teenager.\n";
        }
        else if(age >= 20 && age < 50) {
          cout << "you are a grown adult.\n";
          }
    else {
      cout << "you are an old, elderly person\n";
      }
    
    system("pause");  //This is only required if the compiler is acting up
    
    return 1;   //checks for any errors
    
    }
It is complaining about line 42
system("pause"); //This is only required if the compiler is acting up
Use of system() should be avoided. In this case the online compiler simply rejects it - this could be an attempt to hack the server or other security risk. Just remove that line.

As for downloading a proper compiler, yes I recommend that too,
Topic archived. No new replies allowed.