|
-
Sep 6th, 2011, 12:19 AM
#1
Thread Starter
Junior Member
[RESOLVED] Simple C error!
C Code:
#ifndef _readIn_h #define _readIn_h void readIn(polynomial*, settings*); #endif
polynomial and settings are typedef structs in a header file that readIn.C uses. So i shouldnt have to include the header file in this header file right?
Says it expects ')' before the '*' token... but it is fine and so is all other files... no other errors so i am a little confused!
-
Sep 6th, 2011, 09:37 AM
#2
Re: Simple C error!
Without knowing any more about this, it appears to me that you don't have a definition for "polynomial" and "settings" defined anywhere in the scope here. The general form of your prototype seems right but the compiler doesn't recognize the two keywords.
-Max
The name's "Peck" .... "Max Peck"
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair
-
Sep 6th, 2011, 08:40 PM
#3
Thread Starter
Junior Member
Re: Simple C error!
adt.h
C Code:
#include <stdio.h> #include <stdlib.h> /* ONLY ARRAYS NEED TO BE POINTERS */ /* Polynomial Structure */ typedef struct { int degree; double* coe; double constant; } polynomial; /* Settings Structure */ typedef struct { int upper; int lower; double iterations; } settings; /* Results Structure */ typedef struct { double stdDev; double stdErr; int Fi; int Fav; double solution; } results;
readin.c
C Code:
#include <stdio.h> #include <math.h> #include <stdlib.h> #include "adt.h" void readIn(polynomial* p, settings* s) { /* reads in all data */ /* didn't copy it for length reasons */ /* had no errors though */ }
readin.h
C Code:
#ifndef _readIn_h #define _readIn_h void readIn(polynomial*, settings*); #endif
These are the related files and code not sure if this helps you?... i might try using a different IDE for this assignment if i can if i cant figure it out by end of today.
-
Sep 7th, 2011, 12:12 AM
#4
Thread Starter
Junior Member
Re: [RESOLVED] Simple C error!
Ooooo appears the error was in the main.c file... using Quincy and the formatting of errors is a bit weird thought there was only one... but i had included readIn.h before adt.h and it didn't like that so done...
C Code:
#include "adt.h" #include "readIn.h"
Fixed
-
Sep 7th, 2011, 09:32 AM
#5
Re: [RESOLVED] Simple C error!
The name's "Peck" .... "Max Peck"
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|