multiple-definition

Is there a way to check if a label is already defined in LaTeX?

I edited the question after David Hanak's answer (thanks btw!). He helped with the syntax, but it appears that I wasn't using the right function to begin with. Basically what I want is to let the compiler ignore multiple definitions of a certain label and just use the first. In order to do that, I thought I'd just do something like this...

How to change the meaning of pointer access operator

Hi All, This may be very obvious question, pardon me if so. I have below code snippet out of my project, #include <stdio.h> class X { public: int i; X() : i(0) {}; }; int main(int argc,char *arv[]) { X *ptr = new X[10]; unsigned index = 5; cout<<ptr[index].i<<endl; return 0; } Question Can I change the meaning of...

How do I link in functions from a .cpp source file that also has a 'main'?

I want to use some functions from a .cpp source file that has a main function in my .cpp source file. (I'm building with make and gcc.) Here's the rule from my Makefile: $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) $(LIBS) -o $@ And here's the output (with some names changed to prevent distraction): $ make foo g++ -g -Wall -m32 -Ilinux/i...