freelanceprogrammers.org Forum Index » C
Associative Array
Joined: 28 Jul 2003
Posts: 3
Associative Array
The , in function calls are not sequence points. Eg.
Function(x, y, z); /* no sequence points */
a = 1, b = 2; /* sequence point */
John
--- In Programmers-Town@yahoogroups.com, zimbabaoCEO <zimbabao@y...>
wrote:
> as far as my understanding for "sequence points" goes
> in a++ a is changed only once between sequnce points
> as , is a sequnce point so this is not undefined.
>
> correct me if i`m wrong
> Rajaram
>
> --- Shyan Lam <lam@s...> wrote:
> > See reply embedded...
> >
> > > -----Original Message-----
> > > From: jateen bodkhe [mailto:jateen_b@y...]
> > > Sent: Friday, July 25, 2003 04:45
> > > To: Programmers-Town@yahoogroups.com
> > > Subject: *(&Programmers-Town&)* a small question
> > >
> > > Hello myself jateen,
> > > i have a small question.
> > Here it
> > > is. Please send me tha correct reason for getting
> > such
> > > answer.
> > > int a=10;
> > > printf("%d,%d,%d",a,a--,a++);
> > ^^^^^^^^
> > Undefined behavior.
> > < http://www.eskimo.com/~scs/C-faq/q3.2.html >
> > < http://www.eskimo.com/~scs/C-faq/q3.8.html >
> >
> > > what should be the output?
> >
> > As for undefined behavior, the output can be
> > anything, including no
> > output, program crashes, system crashes,
> > reformatting your hard drive,
> > etc...
> >
> > > will it be 10 10 9 or something else check it and
> > send
> > > the answer with reason if its different that what
> > > might u expect.
> >
> > The reason is because `a` is being modified more at
> > once between
> > sequence points.
> >
> > HTH
> > Shyan
Joined: 19 Jul 2003
Posts: 29
Associative Array
--- Fernando_Concei�o <fernando.listas@...>
wrote:
> Sorry, but what is "LHS", "L-value" and "Maps"?
1. LHS = Left Hand Side (to the "=" sign, means the
side contaning the variable name, the L-value)
2. L-value = the string which is supposed to act as a
variable, i.e. it can be assigned some value
3. Map = A data structure among others like arrays,
queues, dictionaries, vectors, hashmaps, trees etc
HTH
Regards,
Shantanu
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Joined: 25 Jul 2003
Posts: 48
Associative Array
A comma operator indeed defines a sequence point. However, commas in a
function calls that separate parameters is not an operator and therefore
is not a sequence point.
HTH
Shyan
> -----Original Message-----
> From: zimbabaoCEO [mailto:zimbabao@...]
> Sent: Saturday, July 26, 2003 00:51
> To: Programmers-Town@yahoogroups.com
> Subject: RE: *(&Programmers-Town&)* a small question
>
> as far as my understanding for "sequence points" goes
> in a++ a is changed only once between sequnce points
> as , is a sequnce point so this is not undefined.
>
> correct me if i`m wrong
> Rajaram
>
Joined: 08 Jul 2003
Posts: 6
Associative Array
On Fri July 25 2003 10:38, Fernando Conceição wrote:
> Hi all!
> I want to create an class(c++ with wxWindows) to use associative array
> like i use in PHP, var["varIndex"]="value", I know I can make things
> like this var=myarray("index") using the operator() and this is part of
> I want.
> The part I don´t know is to do something like this:
> myarray("index")=var, using () and = in a once.
> If I can´t do in this way, what can I try?
hi
use a template with a vector.
so index is
<template class c,class d>
vector<c> index;
vector<d> value;
don`t bother abt syntax.
Now equate both indexes.
Also placing them in inc order will reduce the time for search.
Also look if u can implement constant pointers/iterators.
which is most important.
also look at boost.org
-suman
All times are GMT
Page 2 of 2
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







