Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Maarten Brock
05/24/12 02:05
Read: 474 times
Tilburg
The Netherlands


 
#187486 - Does not compile
Responding to: Stefan Kanev's previous message
The code you show will not compile. Please fix those errors first while learning to best C on the way.

Then I strongly recommend against putting definitions (the actual instantiations) of variables in header files. Only put extern declarations in header files and define the variables in a .c file. Make sure the implementation file also includes the header file with declarations so the compiler can verify the definitions against the declarations.

List of 15 messages in thread
TopicAuthorDate
const strings in C      Stefan KAnev      05/23/12 23:27      
   Does not compile      Maarten Brock      05/24/12 02:05      
      my question was      Stefan KAnev      05/24/12 04:21      
         Common to play with #define EXTERN      Per Westermark      05/24/12 05:41      
            Common doesn't mean recommended      Oliver Sedlacek      05/25/12 09:43      
               well I recommend it      Erik Malund      05/25/12 10:13      
               No - not hard to maintain at all      Per Westermark      05/25/12 12:44      
   C strings      Per Westermark      05/24/12 03:00      
   Whats wrong with a header file?        Oliver Sedlacek      05/24/12 10:08      
      nothing wrong, double work      Stefan KAnev      05/24/12 11:04      
         It works, and has advantages      Oliver Sedlacek      05/25/12 07:06      
         I got in a total absolute magnificent mess      Erik Malund      05/25/12 07:58      
   thanks to everyone, and next question is      Stefan KAnev      05/25/12 14:46      
      about (tables of) pointers to const strings      Stefan KAnev      05/25/12 14:47      
         C++ and style      Maarten Brock      05/26/12 03:57      

Back to Subject List