![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
troublesome c problem
okay im using dev-C++ with the gcc compiler and when i have a prototype like this:
void LoadVariable(char *); and here's the code for that function: void LoadVariable(char *Name) /* Load a Variable to the Primary */
{
char a_string[30]; /* Register */
strcpy(a_string, "mov ax, ");
strcat(a_string, Name);
EmitLn(a_string);
}(yeah EmitLn() is a function and i #included'ed <string.h> so that's fine). but when i try to compile dev-C++ says "Conflicting types for LoadVariable()" and says it's on the line for its prototype. and then it says "previous implicit declaration of LoadVariable() was here" for the line where i try to call it. can anybody help???
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
How do you call the function? from where-ever it is you need to call it.
It seems like you may be calling it "wrong" according to the prototype, i.e. it is argument mismatch and the debugger points you back to the prototype. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5
![]() |
It sounds like the compiler is seeing the prototype after the code where the function is called. For example;
int main()
{
char *something[] = whatever();
LoadVariable(something);
}
void LoadVariable(char *);You might also see something similar if you attempt to pass arguments of different type than char * to LoadVariable(). For example, if you pass a const char * ..... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|