help with C++ error message

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

gundamhamtar

Thread Starter
Joined
Apr 19, 2004
Messages
39
i got this error "parse error before * token" in my header file.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

/* Constants */
#define MAX 99
#define TRUE 0
#define FALSE 1

/* methods */
void loadstuff(SpreadSheet* ss, char* argv); //error here

SpreadSheet is a struc that i have in another header, which is in the same folder. this is all i have in my header. can anyone tell me what i'm doing wrong? thanks!!
 
Joined
Sep 3, 2002
Messages
828
I don't see that you #include'd your header for your SpreadSheet struct. SpreadSheet is problbly unknown.
 
Joined
Jun 15, 2005
Messages
431
aewarnick is right. Just having a header file in the same directory does not make its contents available to your program. You need to #include it in your program file here.

Also, just a couple of hints:
In a function prototype, it is better not to name your parameters. So, it should look like:
void loadstuff(SpreadSheet *, char * );

Also, "argv" historically stands for "argument vector" and is conventionally either an array of pointers to char to a pointer to pointer to char - not just a pointer to char. Not to say you CAN'T use the name for a pointer to char, it's just a little off-putting to experienced programmers.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top