You are here:

C++/Can you tell me why I'm getting the following errors


The code is as follows

#include <string>
#include <iostream>

class FormClass
        char *httpReferer;
        char *remoteAddr;
        char *requestMethod;
        long contentLength;
        char *remoteUser;
        char *authType;
     } envVars;

     string inputData;
     Function GetEnvVars ();
     Function GetData();
     Function FormClass::ProcessInput();
     Function FormClass::ProcessField(string token);


class StringData
     string fieldValue;
     string fieldName;

I'm an amatuer c++ programmer.  Actually I got this code off my book but I keep getting errors!

     Function GetEnvVars ();
     Function GetData();

I believe it's these lines that're causing the problems, But here's the precise error message:
formclass.h:19 syntax error before '('

I have no idea what this means.

Please, can you help me out?

Hi there:
 I hope u'll be fine. There is only a little "Typing Mistake" in ur code: When calling a function the function brackets must come immediately after the function name with no spaces in between. So the line

Function GetEnvVars ();

should be

Function GetEnvVars();

Plz. feel free to ask a followup, if u need to.
Thanks for contacting me


All Answers

Answers by Expert:

Ask Experts




I can answer any questions that range from the very basics of c++ to the advanced topics like polymorphism, inheritance, composition, multiple inheritance and templates. I can also answer almost every type of questions about c++ data structures like stack, queue, circular queue, linklist(single, double, circular), binary trees, binary search trees, avl trees, 2-3 and 2-3-4 trees. I dont have much experience of mfc and creating guis in visual c++, so plz. dont ask me questions about that.


I'm working in c++ since the last 6 years. I've good working skills specially in the advanced topics like inheritance, polymorphism and all type of c++ data structures.

©2016 All rights reserved.