by: Ben |
last post by:
For many times, I've found myself changing my member variables from
const back to non-const. No matter how good the original objective
was, there was always at least one reason not to use const...
|
by: Zeng Dinghao |
last post by:
char c = 'd';
const char cc = 'd';
char* pc = "dfdfdf";
const char* pcc = "dfdfdf";
char const* cpc = "dfdf";
cout << typeid(c).name() << endl;
cout << typeid(cc).name() << endl;
cout <<...
|
by: Pelle Beckman |
last post by:
Hi,
I saw this code in an earlier post
(not that there's anything wrong with it)
#include <iostream>
using std::cout;
const int hour = 3600;
const int min = 60;
|
by: herbertF |
last post by:
Hi guys,
In a program (not my own) I encountered the declaration of a constant
pointer to an array consisting of two other const pointers to arrays.
Not quite sure why they do it so complicated,...
|
by: Chris |
last post by:
Hi,
can you define const-functions in C# as in C++ ?
for example (C++-code) :
int Cube :: GetSide() const
{
return m_side;
}
|
by: Stabiplan BV |
last post by:
Hi,
I am trying to find const variables outside a class. Thur far I did not
succeed. Without const, the variable is found but with const not.
So, how can I get hold on global const variables...
|
by: Rui.Hu719 |
last post by:
Hi, All:
I read the following passage from a book:
"There are three exceptions to the rule that headers should not contain
definitions: classes, const objects whose value is known at compile...
|
by: sam_cit |
last post by:
Hi Everyone,
When a variable is declared as const, it is initialized along with
the declaration, as modification later on is not possible.
Having seen that, how about const variables in a class?...
|
by: Kira Yamato |
last post by:
It is erroneous to think that const objects will have constant behaviors too.
Consider the following snip of code:
class Person
{
public:
Person();
string get_name() const
|
by: Stephen Howe |
last post by:
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|