There is a #define that I need in both of my source files. How do I do this without getting a duplicate error?
Do I include the .h file into the .c file of the same name?
Type: Posts; User: yougene
There is a #define that I need in both of my source files. How do I do this without getting a duplicate error?
Do I include the .h file into the .c file of the same name?
This is an example from the Make manual so I think it is supposed to be a working example.
I just realized that all the targets are object files which means no linking will be done. That makes...
I got this code from the Make manual.
make Deduces - GNU `make'
objects = main.o kbd.o command.o display.o \
insert.o search.o files.o utils.o
edit :...
What is the implicit rule for handling a header file as a prerequisite?
e.g
main.o : defs.h
kbd.o : defs.h command.h
command.o : defs.h command.h
display.o : defs.h...
Yeah, it's GCC
mmmm, C voodoo
Thanks guys
Thanks for all the helpful replies
@laserlight
if the types of parameters are unspecified why does this produce an error for me?
#include <stdio.h>
void function1();
Take this code as an example
#include <stdio.h>
void function1();
void function2( void );
int main()
{
Lets say you see a function whose code isn't provided in that file and is probably in one of the headers. How would you go about figuring out which header that function belongs to. Obviously you...
Ahhh ok. So I actually have a pseudo-function
PARAMS ((char *filename))
which gets converted to ARGS which really just means whatever is inside the parameter.
What purpose is doing all this...
Thanks this has all been insightful.
Let me show what I do understand so far so maybe someone can fill in the gaps.
void (*print_object_filename) PARAMS ((char *filename));
for example
...
I'm taking a look at all the good stuff GNU has made and I ran into something I have never seen before.
For example line 166 in binutils-2.9.1/bin-utils/nm.c you have this
/* Support for...
I always see the stack and heap mentioned in CS books. I'd like to understand more about them.
Are heaps and stacks different areas of memory, or different ways to use memory?
What would be a...
thanks
No, what does -lm do?
It works fine with 1 variable one value. I don't understand why.
/tmp/cc4KSEcQ.o: In function `main':
test.c:(.text+0x2f): undefined reference to `pow'
collect2: ld returned 1 exit status
I guess I have much more to learn
>>cas
Thanks. How did you find the error so fast?
I've never gotten an error like this before. Could someone tell me what it means?
I think the error is contained in the convertToPostfix function.
*** glibc detected *** ./a.out: double free...
eugene@eugene-laptop:~/cfiles$ cc 12.12.c
/tmp/cc7U4qkP.o: In function `convertToPostfix':
12.12.c:(.text+0xd6): undefined reference to `isDigit'
collect2: ld returned 1 exit status
Isn't...
What would be good form?
I was originally going to use if, else if, else. Both have the same short-coming in my mind although in different ways.
The way I did it has the possibility of not...
1. Will this cause problems if I do pass user-input?
2. The function is going to be used in conjunction with isOperator().
Ahh thank you.
This brings up a more precise question.
1. Which part of the statement is the "initializer element" ?
2. What does it mean that it's "non-computable at load-time" ?
What does this warning mean?
12.12.c:54: warning: initializer element is not computable at load time
12.12.c:54: warning: initializer element is not computable at load time
Look at the...
1.
if ( conductor != 0 )
is a roundabout way of checking if malloc was able to allocate memory to root. If no memory was allocated malloc returns a NULL pointer address.
2.
The code at hand is...