Possible Duplicate: What do two question marks together mean in C#? What does the ?? mean in this C# statement? int availableUnits = unitsInStock ?? 0;

what does ** mean in C

What does it mean when a object has 2 asterisks at the beginning? **variable

What does it mean to have an undefined reference to a static member?

I just wrote a class with some static data members, but now I am getting errors about undefined references. Why doesn’t this work? What am I doing wrong? (Note: This is meant to be an entry to Stac

Answers

You’re getting a linker error, so your extern is working (the compiler compiled a.c without a problem), but when it went to link the object files together at the end it couldn’t resolve your extern — void doSomething(int); wasn’t actually found anywhere. Did you mess up the extern? Make sure there’s actually a doSomething defined in b.c that takes an int and returns void, and make sure you remembered to include b.c in your file list (i.e. you’re doing something like gcc a.c b.c, not just gcc a.c)

You need to link both a.o and b.o:

gcc -o program a.c b.c

If you have a main() in each file, you cannot link them together.

However, your a.c file contains a reference to doSomething() and expects to be linked with a source file that defines doSomething() and does not define any function that is defined in a.c (such as main()).

You cannot call a function in Process B from Process A. You cannot send a signal to a function; you send signals to processes, using the kill() system call.

The signal() function specifies which function in your current process (program) is going to handle the signal when your process receives the signal.

You have some serious work to do understanding how this is going to work – how ProgramA is going to know which process ID to send the signal to. The code in b.c is going to need to call signal() with dosomething as the signal handler. The code in a.c is simply going to send the signal to the other process.

You need to compile and then link like this

gcc -c a.c gcc -c b.c gcc a.o b.o -o prog

An initial reaction to this would be to ask and ensure that the two object files are being linked together. This is done at the compile stage by compiling both files at the same time: