473,883 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Const declaration in header files

Hi

Just going over some grey areas in my knowledge in C++:

1) If I have

const int SomeConst = 1;

in a header file, it is global, and it is included in multiple translations
units, but it is unused, I know that it does not take up storage in the
final executable.

What about the following

const double SomeConst2 = 2.0;
const char SomeConst3[] = "A value1";
const char *SomeConst4 = "A value 2";

do they wind up in the final executable?

2) What about the last two statements with const missing and placed in a
header file

char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";

At this point, including in 2+ translation units would fall foul of the one
definition rule, right?

3) If I have

const int SomeConst = 1;

in a header file, it is global, is it static or extern by default?

Thanks

Stephen Howe
Jun 27 '08 #1
10 5988
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
Hi

Just going over some grey areas in my knowledge in C++:

1) If I have

const int SomeConst = 1;

in a header file, it is global, and it is included in multiple
translations units, but it is unused, I know that it does not take up
storage in the final executable.
If something is unused, the compiler can throw it out on "as-if" basis,
or then not. This is mostly QOI issue. If the variable definitions are
incorrect and the standard requires a diagnostic about that, the
implementation has to produce the diagnostic regardless of whether he
would encode the variables in the executable or not.

If the code happens to take the address of i somewhere, the compiler is
obliged to ensure that at runtime there will be an int variable present
with the proper value, so that the address can be taken. This most
probably means that the value is somehow encoded in the executable - I
guess this is what you mean when you talk about storage in the
executable.

However, this is all not so important, unless you work on embedded
systems, counting single bytes. What is important that in C++ the const
object definitions can legally appear in multiple translation units,
without causing linker errors about multiple definitions. Of course, all
definitions must be identical. This enables to use such definitions in
common header files instead of ancient C macros.
>
What about the following

const double SomeConst2 = 2.0;
const char SomeConst3[] = "A value1";
The same as 'const int'. These definitions can be included in many
translation units.
const char *SomeConst4 = "A value 2";
Here SomeConst4 is not const, so the rule does not apply and one will
most probably get linker errors when trying to include this in multiple
translation units. Add 'const' to make it working.
>
do they wind up in the final executable?
Why do you care?
>
2) What about the last two statements with const missing and placed
in a header file

char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
The const you dropped is not the top-level one, so it does not have any
significance here.
>
At this point, including in 2+ translation units would fall foul of
the one definition rule, right?
The same as for SomeConst3 (ok) and SomeConst4 (fails).
>
3) If I have

const int SomeConst = 1;

in a header file, it is global, is it static or extern by default?
This is not the right termonology, the standard speaks about external and
internal linkage, etc. I am not sure I can get the details right so I
skip that.

hth
Paavo
Jun 27 '08 #2
On Sat, 24 May 2008 19:22:55 +0100, "Stephen Howe"
<sjhoweATdialDO TpipexDOTcomwro te in comp.lang.c++:
Hi

Just going over some grey areas in my knowledge in C++:

1) If I have

const int SomeConst = 1;

in a header file, it is global, and it is included in multiple translations
units, but it is unused, I know that it does not take up storage in the
final executable.
It is not "global", C++ does not have anything that maps all that well
to what is normally meant by that concept. The const keyword used at
namespace scope in C++ provides internal linkage, unless you
specifically add the extern keyword as well.

What you have defined is a constant int with internal linkage. It
might or might not take up storage in the final executable, if you do
not take its address. If you do take its address and use it in a way
such that compiler cannot verify that it won't be dereferenced, then
it must take up space at run time when that address is used.

If you include the header file in multiple translation units, each
translation unit will wind up with its own distinct copy.
What about the following

const double SomeConst2 = 2.0;
const char SomeConst3[] = "A value1";
const char *SomeConst4 = "A value 2";

do they wind up in the final executable?
That is entirely up to your compiler, not the language, unless again
you use the address of these objects in some way.
2) What about the last two statements with const missing and placed in a
header file

char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";

At this point, including in 2+ translation units would fall foul of the one
definition rule, right?
Well, you would almost certainly have complaints from the linker.
3) If I have

const int SomeConst = 1;

in a header file, it is global, is it static or extern by default?
No, it isn't global, C++ doesn't really have "global". The closest
C++ has to global is external linkage. But defining something with
external linkage in one translation unit does not automagically make
it "global", that is accessible by name throughout the entire program.

Any objects defined at namespace scope have static storage duration.
If the definition includes either or both of the const or static
keywords, the object has static storage duration and internal linkage.
If the definition does not include either of these keywords, the
object has static storage duration and external linkage.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Jun 27 '08 #3
On Sat, 24 May 2008 15:46:58 -0500, Paavo Helde <no****@ebi.eew rote
in comp.lang.c++:
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
Hi

Just going over some grey areas in my knowledge in C++:

1) If I have

const int SomeConst = 1;

in a header file, it is global, and it is included in multiple
translations units, but it is unused, I know that it does not take up
storage in the final executable.
[snip]
However, this is all not so important, unless you work on embedded
systems, counting single bytes. What is important that in C++ the const
object definitions can legally appear in multiple translation units,
without causing linker errors about multiple definitions. Of course, all
definitions must be identical. This enables to use such definitions in
common header files instead of ancient C macros.
Actually, the definitions need not be identical at all, especially for
built-in types.

I can have in one source file:

const int SomeConst = 1;

....and in another:

const int SomeConst = 42;

....with no problem at all.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Jun 27 '08 #4
On May 24, 8:22 pm, "Stephen Howe" <sjhoweATdialDO TpipexDOTcomwro te:
Just going over some grey areas in my knowledge in C++:
1) If I have
const int SomeConst = 1;
in a header file, it is global, and it is included in multiple
translations units, but it is unused, I know that it does not
take up storage in the final executable.
Wrong on both counts. First, the variable has internal linkage,
which means that there is a different SomeConst for each
translation unit in which it is defined. And second, whethere
it does or does not take up storage is purely implementation
defined. Conceptually, it takes up sizeof(int) bytes in each
translation unit; most compilers probably will detect that if it
is not used, this fact makes no difference, and will suppress
it, but this is really an optimization.
What about the following
const double SomeConst2 = 2.0;
const char SomeConst3[] = "A value1";
const char *SomeConst4 = "A value 2";
do they wind up in the final executable?
Same rules as above for the first two. As far as the standard
is concerned, they are physically present in each translation
unit; if they aren't, it's the result of a space optimization by
the compiler.

The third is different: because the variable itself isn't const,
the declaration has external linkage by default, and its
presence in more than one translation unit is a violation of the
one definition rule.
2) What about the last two statements with const missing and
placed in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
These do have external linkage, so the names SomeConst5 and
SomeConst6 refer to the same object when used in different
translation units. And as you say...
At this point, including in 2+ translation units would fall
foul of the one definition rule, right?
Right. The const equivalent to the above would be:

extern char const SomeConst5[] = "A value 3";
extern char * const SomeConst6 = "A value 4";

Similarly, to make SomeConst5 and SomeConst6 have internal
linkage, without being const:

static char SomeConst5[] = "A value 3";
static char *SomeConst6 = "A value 4";

For *definitions* at namespace scope, you can always specify the
linkage explicitly, by means of extern or static, provided you
furnish an explicit initializer. For *declarations* at
namespace scope, you can always force external linkage by
specifying extern; there are cases, I think, where you cannot
create a declaration with internal linkage which is not also a
definition (if the variable is const, for example). The default
depends on whether the variable itself is const or not.
3) If I have
const int SomeConst = 1;
in a header file, it is global, is it static or extern by default?
static.

The rules are far from orthogonal, and the relationships between
the keywords and what they do are complex and arbitrary. For
historical reasons, of course---no one would design this sort of
thing intentionally from scratch.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #5
On May 24, 10:46 pm, Paavo Helde <nob...@ebi.eew rote:
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
Just going over some grey areas in my knowledge in C++:
1) If I have
const int SomeConst = 1;
in a header file, it is global, and it is included in
multiple translations units, but it is unused, I know that
it does not take up storage in the final executable.
If something is unused, the compiler can throw it out on
"as-if" basis, or then not. This is mostly QOI issue. If the
variable definitions are incorrect and the standard requires a
diagnostic about that, the implementation has to produce the
diagnostic regardless of whether he would encode the variables
in the executable or not.
If the code happens to take the address of i somewhere, the
compiler is obliged to ensure that at runtime there will be an
int variable present with the proper value, so that the
address can be taken. This most probably means that the value
is somehow encoded in the executable - I guess this is what
you mean when you talk about storage in the executable.
The as-if rule holds here as well. Probably the most frequence
case of "taking the address" of an int const is when passing it
to an int const& argument; such arguments generally only result
from the expansion of a template, and in the absense of export,
the compiler has access to the source code of the function, and
can (potentially, at least) see if in fact, it could use the
value directly just as well. Thus, if you have an
std::vector<int >, and do a push_back( SomeConst ) on it, there's
a very good chance that the compiler will not need to allocate
memory for SomeConst then either, despite the fact that in the
abstract machine, it has "taken the address" of the constant.
However, this is all not so important, unless you work on
embedded systems, counting single bytes. What is important
that in C++ the const object definitions can legally appear in
multiple translation units, without causing linker errors
about multiple definitions. Of course, all definitions must be
identical. This enables to use such definitions in common
header files instead of ancient C macros.
It can be important for two reasons. The first, of course, is
if you have header files with lots of such values, say a couple
hundred, and you end up incorporating the header in many very
small source files. In such cases, while not likely, it *can*
end up making a difference. Particularly if those source files
also have some static variables, which becaue of the extra
variables end up on separate pages in virtual memory. Program
size is important today, for reasons of locality. (The number
of programs affected will be very small, of course.)

The second is that using the variable in a template may cause
problems. The template definition will also be included in
multiple translation units, and according to the standard, there
will be undefined behavior if the token sequence of the
definition differs, OR if any name binding differs. In this
case, the name binding of SomeConst will be different in each
translation unit, i.e. the symbol SomeConst will refer to a
different entity in each translation unit. The standard does
make an exception to this if the symbol is an integral constant
expression (as it is here), with the same type and initializer
value everywhere, *and* only if the address of the object is not
used. (Note that passing the value by reference is using the
address!)

[...]
do they wind up in the final executable?
Why do you care?
Locality? Limited memory? (I've worked on systems where the
entire application had to fit into 64KB, including the OS.)
2) What about the last two statements with const missing and placed
in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
The const you dropped is not the top-level one, so it does not
have any significance here.
In the second line. In the first, it changes the linkage.
At this point, including in 2+ translation units would fall foul of
the one definition rule, right?
The same as for SomeConst3 (ok) and SomeConst4 (fails).
Do you mean that SomeConst3 and SomeConst5 are the same? I
don't think so.

Actually, the more I think about it, the less sure I am. In C,
at least, there is no such thing as a const array, so the const
isn't top level. G++ treats them as if the arrays themselves
were const, however (i.e. as if the const were top level).
3) If I have
const int SomeConst = 1;
in a header file, it is global, is it static or extern by default?
This is not the right termonology, the standard speaks about
external and internal linkage, etc. I am not sure I can get
the details right so I skip that.
In this case, supposing that the definition is at namespace
scope, it is internal linkage. But the rules aren't really very
orthogonal, and can easily lead to confusion.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #6
James Kanze <ja*********@gm ail.comkirjutas :
On May 24, 10:46 pm, Paavo Helde <nob...@ebi.eew rote:
>"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
2) What about the last two statements with const missing and placed
in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
>The const you dropped is not the top-level one, so it does not
have any significance here.

In the second line. In the first, it changes the linkage.
Yes, you are right. I was not prepared to have yet more subtleties,
especially such seemingly illogical ones. It's my fault I know, but I
cannot understand why should const char array have different linkage than
variable char array? Probably something to do with C legacy?

OK, I can see some logic here, if the arrays are considered to be
extension of a single object to case N>1, then it makes sense that
extension of const/non-const object shares the same linkage as the single
object. However, in almost all other contexts the array is equivalent to
a pointer to a object - I think this is the source of my confusion.

Regards
Paavo
Jun 27 '08 #7
On May 25, 10:39 pm, Paavo Helde <nob...@ebi.eew rote:
James Kanze <james.ka...@gm ail.comkirjutas :
On May 24, 10:46 pm, Paavo Helde <nob...@ebi.eew rote:
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
2) What about the last two statements with const missing and placed
in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
The const you dropped is not the top-level one, so it does
not have any significance here.
In the second line. In the first, it changes the linkage.
Yes, you are right. I was not prepared to have yet more
subtleties, especially such seemingly illogical ones. It's my
fault I know, but I cannot understand why should const char
array have different linkage than variable char array?
Probably something to do with C legacy?
Well, nothing involving const is due to C legacy, since C++ had
const before C did. I'm pretty sure that the initial
modiviation for const affecting linkage is due to things like:

int const dim = 43 ;

In C++, `dim' has been a constant integral expression from the
day const was introduced (where as it is not a constant integral
expression in C, even today). To work as a constant integral
expression, of course, you need the initializer. And there are
a lot of constant integral expressions which you'll want in
header files as well. If the linkage of the above were external
(as it is in C, or without the const), you'd have to write:

static int const dim = 43 ;

if you wanted to avoid duplicate definitions. And while
personally, that doesn't bother me, apparently, it did bother
some early users, and the rule was made (very early) that const
variables default to internal linkage (i.e. as if they were
declared static).

All of this was long before templates, of course, so the fact
that you cannot use the address of dim as a template argument
wasn't considered, nor the fact that passing dim by reference in
a function template results in undefined behavior.
OK, I can see some logic here, if the arrays are considered to
be extension of a single object to case N>1, then it makes
sense that extension of const/non-const object shares the same
linkage as the single object. However, in almost all other
contexts the array is equivalent to a pointer to a object - I
think this is the source of my confusion.
An array is never really equivalent to a ponter to an object.
It converts to a pointer to the first element in some specific
cases, in expressions, but there is still a conversion involved.
A pointer designates an object; it is NOT that object, nor does
it contain that object. An array contains its members, and is
actually more like a struct than a pointer.

The fact remains that in:
int const array[ N ] ;
it is the "int" that is const, and not the array, so the const
isn't top level, and that at least in C, "If the specification
of an array type includes any type qualifiers, the element type
is so qualified, not the array type." So even if you write:
typedef int A[ N ] ;
A const array ;
at least in C, it is not a top level const (not that this makes
a difference in C). So strictly speaking, I don't think that
the array definition has top level const, according to the
standard. On the other hand, at least three compilers (Sun CC,
g++ and VC++) treat it as if it does.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #8
On May 26, 6:28 am, "Alf P. Steinbach" <al...@start.no wrote:
* Paavo Helde:
On May 24, 10:46 pm, Paavo Helde <nob...@ebi.eew rote:
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
2) What about the last two statements with const missing and placed
in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
The const you dropped is not the top-level one, so it does not
have any significance here.
In the second line. In the first, it changes the linkage.
Yes, you are right. I was not prepared to have yet more
subtleties, especially such seemingly illogical ones. It's
my fault I know, but I cannot understand why should const
char array have different linkage than variable char array?
Probably something to do with C legacy?
The two declarations shown above do not have top-level const.
They provide assignable variables. Since they're assignable
variables, not 'const', they have external linkage by default.
The real question here is:
char const SomeConst[] = "A value" ;
Does SomeConst have external linkage, or internal? Intuitively,
I would say internal (and g++, Sun CC and VC++ agree with me),
but I can't find anything in the standard to back this up. And
if this has internal linkage, how is it different from:
struct Toto
{
int const i ;
} ;
Toto x = { 43 } ;
In both cases, we have an agglomerate in which all elements are
const (but the agglomerate itself is not declared const).

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #9
On May 26, 1:13 pm, "Alf P. Steinbach" <al...@start.no wrote:
* James Kanze:
On May 26, 6:28 am, "Alf P. Steinbach" <al...@start.no wrote:
* Paavo Helde:
On May 24, 10:46 pm, Paavo Helde <nob...@ebi.eew rote:
"Stephen Howe" <sjhoweATdialDO TpipexDOTcomkir jutas:
2) What about the last two statements with const missing and placed
in a header file
char SomeConst5[] = "A value 3";
char *SomeConst6 = "A value 4";
The const you dropped is not the top-level one, so it does not
have any significance here.
In the second line. In the first, it changes the linkage.
>Yes, you are right. I was not prepared to have yet more
subtleties, especially such seemingly illogical ones. It's
my fault I know, but I cannot understand why should const
char array have different linkage than variable char array?
Probably something to do with C legacy?
The two declarations shown above do not have top-level const.
They provide assignable variables. Since they're assignable
variables, not 'const', they have external linkage by default.
The real question here is:
char const SomeConst[] = "A value" ;
Does SomeConst have external linkage, or internal?
Internal.
It's const.
Well, that's what I think it should be, too. But I can't find
anything in the standard to back it up.
Intuitively,
I would say internal (and g++, Sun CC and VC++ agree with me),
but I can't find anything in the standard to back this up.
§3.5/3 would apply if the object, the array, itself was
declared const.
But here it's seemingly the elements that are const, and
seemingly that the array effective constness stems from arrays
not being assignable on their own.
Exactly. In C, the standard says explicitly that there's no
such thing as a const array. The C++ standard doesn't say that
in so many words, but it does say that "Any type of the form
``cv-qualifier-seq array of N T'' is adjusted to ``array of N
cv-qualifier-seq T,[ ...]'', which means that even if you write:

typedef int A[10];
A const a ;

The type of a is array of 10 const int, and the const-ness is
not top level.
There is however a non-normative note at the end of §8.3.4/1
that attempts to explain this. Presumably what it's meant to
explain is that the /intent/ of that paragraph is that
cv-qualification of array elements transfer to the array
object itself.
A very feeble attempt, IMHO. But perhaps sufficient if it were
normative.
Anyway, it explicitly says "internal linkage".
Where?
And
if this has internal linkage, how is it different from:
struct Toto
{
int const i ;
} ;
Toto x = { 43 } ;
In both cases, we have an agglomerate in which all elements are
const (but the agglomerate itself is not declared const).
cv-qualification of elements of a struct does not transfer to
the struct itself.
I know, but according to the standard, the same is true of
arrays. Only more so, because you can't declare an object of
array type const.

Anyhow, I think it's all vague enough for me to raise an issue
with the committee. I'm not sure, but judging from the behavior
of the compilers I've tested, I think that there is more or less
a consensus that the const-ness of the array elements *should*
cause internal linkage (as if the array itself were const); it's
just a question of making this clear in the wording of the
standard.

With regards to the struct above: I rather like the idea that a
PODS in which all elements are const would cause objects of that
type to be const as well, but that would definitely be an
extention, or a change in the language (and it's probably not
important enough to bother with).

Only distantly relevant to the current discussion: I don't see
anything forbidding a union to contain a const object either,
e.g.:

union U { int const a; double b ; } ;

I don't quite see how it could work, however. (Unions are being
reworked in the current draft, to remove a lot of the
restrictions. I'm not sure how this affects const elements in
unions, however.)

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
12555
by: matthurne | last post by:
I just started learning C++ on my own...I'm using Accelerated C++. Something it hasn't explained and I keep wondering about is how header files actually work. I suspect it doesn't get into it because it is, as the authors love to say, "implementation specific". If that's the case, how does the compiler commonly handle them? I use Linux and gcc specifically. Basically, I don't understand how a header file being included makes a...
11
2767
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do understand the objective. This example may represent an interface in need of a bit of refactoring, but it goes to demonstrate the basic idea as I understand it. http://developer.kde.org/documentation/library/cvs-api/kdevelop/html/ast_8h-source.html...
8
3607
by: Sim Smith | last post by:
This is the problem: I have to inherit a third party class file in my library. If I directly do it, I will have to ship the third party header files to my customers as well. I do not want to ship the third party header files to my customers. What is the most elegant way to handle this problem. For example: // MyClass.h
2
2215
by: Kevin Joplin | last post by:
Hi there, I've almost finished writing simple server application and i have one little doubt. Suppose we have main server code in server.c file. Rest of the code we divided into some pices and put into server_2.c, server_3.c etc. Now we need to share some of the server.c variables between server_2.c, server_3.c etc. so we put the declaractions of these variables in server.h with "extern" prefix and include it (server.h) in rest of the...
15
4419
by: Simon Cooke | last post by:
Does anyone know of any tools for refactoring header files? We're using a third party codebase at work, and pretty much every file includes a 50Mb precompiled header file. I'm looking for a tool that will let us figure out which header files are actually needed by each .cpp, and allow us to break this up so that we're not including the world in each one. Ideally, the same tool would also recognize where #includes can be replaced with...
3
10601
by: John Goche | last post by:
A common C++ trend is to use const int foo = 10; where some C programmers would have used #define FOO 10 in order to avoid preprocessor overheads.
8
2821
by: Eric | last post by:
I am writing a program with several header files. I would like for some of them to be aware of others. Here is a small example of my problem in three different files: //// main.c++ #include "A.h" #include "B.h" int main () { using namespace std;
36
3868
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same program will result in a linker error complaining about multiple definitions. So this kind of definition should be avoided as much as possible. But as we know, the definition of a class is always in a header file. And we can use "#ifndef" to eliminate...
11
1365
by: yogpjosh | last post by:
Hi, for whom the header files are important? for the programmer or for the compiler..?? As the programmer very well sees all the private data of a class through the header file ..but if he tries to access it then the compiler throws the error..
0
9778
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7959
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.