Hi Guys,
When a function has following arg type,
update_data(const char *const * update_list,...)
exactly what object type update_list can take?
For example, I can call update_aaa() using following variale as an
arg:
const char *updatelist_default[]={ "aaa", "bbb", NULL};
Then, why the 2nd 'const' is necessary ? I mean,
update_data(const char * * update_list,...) would work. But actually
not! 2 2006
Some errata. Just see below again:
On Apr 5, 7:10 pm, itsolut...@gmail.com wrote:
Hi Guys,
When a function has following arg type,
update_data(const char *const * update_list,...)
exactly what object type update_list is supposed to take?
For example, I can call update_data() using following variale as an
arg:
const char *updatelist_default[]={ "aaa", "bbb", NULL};
Then, why the 2nd 'const' is necessary ? I mean,
I thought update_data(const char * * update_list,...) would work. But actually
not! If not "const char *const * ", compiler complains!
<it********@gmail.comschrieb im Newsbeitrag
news:75**********************************@m1g2000p re.googlegroups.com...
[snip]
If not "const char *const * ", compiler complains!
What does he complain about? Post a builtable code snippet which triggers
the warning, otherwise it is kinda hard to determine what is wrong. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steven T. Hatton |
last post by:
Sorry about the big code dump. I tried to get it down to the minimum
required to demonstrate the problem. Although this is all done with GNU, I
believe the problem I'm having may be more general. ...
|
by: TechCrazy |
last post by:
What do each of these mean? Thanks. I am incredibly confused.
char foo (const char * &p );
char foo (const char &* p );
char foo (const &char * p );
char foo (const char...
|
by: al |
last post by:
char s = "This string literal";
or
char *s= "This string literal";
Both define a string literal. Both suppose to be read-only and not to be
modified according to Standard. And both have...
|
by: Roger Leigh |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A lot of functions use const pointer arguments. If I have a non-const
pointer, it is transparently made const when I pass it to the
function, e.g....
|
by: Geoffrey S. Knauth |
last post by:
It's been a while since I programmed in C++, and the language sure has
changed. Usually I can figure out why something no longer compiles, but
this time I'm stumped. A friend has a problem he...
|
by: dwaach |
last post by:
Hi,
I am trying to compile the following program,
#include <iostream>
using namespace std;
typedef char* CHAR;
typedef const CHAR CCHAR;
|
by: S S |
last post by:
Hi Everyone
I have
const char *p = "Hello";
So, here memory is not allocated by C++ compiler for p and hence I
cannot access p to modify the contents to "Kello"
p = 'K'; // error at runtime
|
by: d3x0xr |
last post by:
---- Section 1 ----
------
x.c
int main( void )
{
char **a;
char const *const *b;
b = a; // line(9)
|
by: d3x0xr |
last post by:
Heh, spelled out in black and white even :) Const is useles...
do NOT follow the path of considering any data consatant, because in
time, you will have references to it that C does not handle,...
|
by: Peithon |
last post by:
Hi,
This is a very simple question but I couldn't find it in your FAQ.
I'm using VC++ and compiling a C program, using the /TC flag.
I've got a function for comparing two strings
int...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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,...
| |