473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Need explanation with something

Can anyone explain me these things in C++?

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

if(....
{
...

::one;

...
}
....

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.

Apr 22 '06 #1
5 1914
Daniel Vukadinovic wrote:
Can anyone explain me these things in C++?

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

if(....
{
...

::one;
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
Apr 22 '06 #2
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.

Apr 22 '06 #3
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.

Apr 22 '06 #4
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

Apr 22 '06 #5
Thank you all for your replies!

Apr 22 '06 #6

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

Similar topics

2
by: Carolyn Gill | last post by:
I have already created an asp login/database for a learning/quiz section on a small site. There will be multiple quizzes through the site and what I need now would be help: tutorials or advice that...
6
by: Unknown User | last post by:
I have been increasingly allergic to table web sites lately, and I'm concerned for my health. Basically these are the symptoms: - Each time I visit a web site, I need to view the source to see if...
7
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One...
7
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a...
17
by: Hazz | last post by:
In this sample code of ownerdraw drawmode, why does the '(ComboBox) sender' line of code need to be there in this event handler? Isn't cboFont passed via the managed heap, not the stack, into this...
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
22
by: the_grove_man | last post by:
I purchased a book titled "Pro ASP.NET 2.0" to get up to speed on web stuff because I ususally do Windows Form Applications.. But in the first chapters I was reading this week it brought to mind...
10
by: CuTe_Engineer | last post by:
hii, i have cs assignment i tried to solve it but i still have many errors , plzz help mee :"< it`s not cheating becuz i`ve tried & wrote the prog. i just wanna you to show me my mistakes ...
4
by: adam_kroger | last post by:
BRIEF EXPLANATION: I have 6 TextBoxes named LIS1, LIS2, LIS3, ... LIS6. I want to be able to reference them using a For/Next loop and either read ot write to them. In VBA I would use something...
1
by: vikjohn | last post by:
I have a new perl script sent to me which is a revision of the one I am currently running. The permissions are the same on each, the paths are correct but I am getting the infamous : The specified...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
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
0
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...
0
Oralloy
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.