static « header « C File Q&A

Home
C File Q&A
1.array
2.binary
3.delete
4.Development
5.directory
6.fgets
7.fopen
8.fprintf
9.fscanf
10.fwrite
11.header
12.include
13.input
14.LINE
15.linux
16.open
17.output
18.pointer
19.read
20.size
21.string
22.struct
23.Text
24.windows
25.write
C File Q&A » header » static 

1. Variable declarations in header files - static or not?    stackoverflow.com

When refactoring away some #defines I came across declarations similar to the following in a C++ header file:

static const unsigned int VAL = 42;
const unsigned int ANOTHER_VAL = 37;
The question is, ...

2. Is there a way to have static prototypes AND public ones in the same header file in C?    stackoverflow.com

The compiler will always whine when I have mixed public with static prototypes in a header file. Say I have header main.h with a static prototype for function a and a normal ...

3. initialization of static data member in header file    bytes.com

Hi there I am trying to provide a lookup from two 'int's into a char array, something like this: template ::A = "BLA"; // continue with Lookup<0,1; Lookup<0,2... Since the initialization is done in the .h file, it gets included ...

4. header files revisited: extern vs. static    bytes.com

John Goche Hello, The extern keyword can be used in C and C++ to share global variables between files by declaring the variable in header file and defining it in only one of the two files. For example, if x were not declared extern in the header file below then the linker would complain about x being multiply defined. -------------------- // ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.