Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Need explanation with something

Reply
Thread Tools

Need explanation with something

 
 
Daniel Vukadinovic
Guest
Posts: n/a
 
      04-22-2006
Can anyone explain me these things in C++?

1.What is :: used for like in the next case:

if(....
{
...

:ne;

...
}
....

2.Do I understand this right?
void something::something:something(...
Is the last something followed after only one : a subclass?

3.What does this mean?
struct something
{
...
} a; ->> what is this used for?

4.Static, const and mutable
Now I read alot about that but I never really understood when do we use
static, const and mutable with variables? I know const is used when we
don't want the value to be changed, but what's static and mutable? I
would appreciate examples so I could understand it better.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-22-2006
Daniel Vukadinovic wrote:
> Can anyone explain me these things in C++?
>
> 1.What is :: used for like in the next case:
>
> if(....
> {
> ...
>
> :ne;


The '::' is a _scope_resolution_ operator. So, it helps resolve
(or override) the scope.

>
> ...
> }
> ...
>
> 2.Do I understand this right?
> void something::something:something(...

.. ^
.. A colon is missing here

> Is the last something followed after only one : a subclass?


Impossible to say.

> 3.What does this mean?
> struct something
> {
> ...
> } a; ->> what is this used for?


Declares an object of that type.

> 4.Static, const and mutable
> Now I read alot about that but I never really understood when do we
> use static, const and mutable with variables? I know const is used
> when we don't want the value to be changed, but what's static and
> mutable? I would appreciate examples so I could understand it better.


What book are you reading that doesn't explain those?

V
--
Please remove capital As from my address when replying by mail


 
Reply With Quote
 
 
 
 
Daniel Vukadinovic
Guest
Posts: n/a
 
      04-22-2006
I know the theory of my problems but I don't know how to use them in
real life.I know a; is a object of that type, but what does that mean?
You know?
I have two my local colledge textbooks and some e-books but I still
don't get it.

 
Reply With Quote
 
Markus Schoder
Guest
Posts: n/a
 
      04-22-2006
Daniel Vukadinovic wrote:
> I know the theory of my problems but I don't know how to use them in
> real life.I know a; is a object of that type, but what does that mean?
> You know?


struct something
{
....
} a;

Is just short for

struct something
{
....
};
something a;

Pure syntactical sugar.

 
Reply With Quote
 
Jonathan Mcdougall
Guest
Posts: n/a
 
      04-22-2006
Daniel Vukadinovic wrote:

Please quote the message you are answering to.

> I know the theory of my problems but I don't know how to use them in
> real life.I know a; is a object of that type, but what does that mean?


Every object has a type which defines, among other things, the
operations you can do on that object. I strongly recommend

1) browsing the FAQ (http://www.parashift.com/c++-faq-lite/)
2) buying a good book (Accelerated C++ from Koenig and Moo is usually
recommended)
3) starting to actually program, this will help you understand the
"theory of your problems"

> I have two my local colledge textbooks and some e-books but I still
> don't get it.


Change them. See www.accu.org for suggestions.


Jonathan

 
Reply With Quote
 
Daniel Vukadinovic
Guest
Posts: n/a
 
      04-22-2006
Thank you all for your replies!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I noticed something with rand and I'm looking for some explanation. mulligan.kyle@gmail.com C Programming 9 03-10-2013 09:54 AM
The following photo is all the explanation you need: MCSE 10 07-21-2004 05:05 PM
The following photo is all the explanation you need: MCSD 6 07-21-2004 05:05 PM
New to .net need help/explanation Dave ASP .Net 4 07-01-2004 04:00 PM
Need Explanation Kaladhaur Palaniappa Perl 0 08-07-2003 09:47 AM



Advertisments