Follow Fantora on Twitter
Fantora Word of Classified Ads and Community Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

c++ question

Options
preet
Posted: Saturday, July 10, 2010 8:09:08 AM
Rank: Newbie
Groups: Member

Joined: 7/10/2010
Posts: 2
Points: 6
Location: US

c++ question

What is the use of constant function, volatile function & static function (in programming & real life)? How do they differ from one another?
_______________

Chimney Sweep
Carpet Cleaning London
hightech
Posted: Monday, July 12, 2010 11:05:25 PM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2008
Posts: 226
Points: 484
Location: US
carmel
Posted: Thursday, July 15, 2010 9:51:03 PM
Rank: Newbie
Groups: Member

Joined: 7/15/2010
Posts: 2
Points: 6
Location: US

c++ question

To understand what are const functions we have to know and understand const objects. Let's say we have class:

class foo{
int x;
public:
foo(int arg): x(arg){}
int y;
};

In main function we write so we create const object initialized with vaue 2:
const foo f(2);
At this point we should ask oureslves what that means?
Well it means that we tell compiler that this object will be constant so none of it's component's during object live will be changed. Well there are no problem for compiler with public members with that all of them will become constant let's say we can now write:

std::cout<<f.y;
but of course:
f.y 3;//This will cause an error
And now if our class will look le't say like this:

class foo{
int x;
public:
foo(int arg): x(arg){}
void f(int arg){}
int y;

carmel hotel rooms
carmel motels
carmel vacation rentals
johnpatrick
Posted: Tuesday, July 20, 2010 5:38:43 AM
Rank: Member
Groups: Member

Joined: 2/25/2010
Posts: 10
Points: 30
Location: GB

c++ question

carmel wrote:
To understand what are const functions we have to know and understand const objects. Let's say we have class:

class foo{
int x;
public:
foo(int arg): x(arg){}
int y;
};

In main function we write so we create const object initialized with vaue 2:
const foo f(2);
At this point we should ask oureslves what that means?
Well it means that we tell compiler that this object will be constant so none of it's component's during object live will be changed. Well there are no problem for compiler with public members with that all of them will become constant let's say we can now write:

std::cout<<f.y;
but of course:
f.y 3;//This will cause an error
And now if our class will look le't say like this:

class foo{
int x;
public:
foo(int arg): x(arg){}
void f(int arg){}
int y;
-----


thanks for coding
salt lamps manufacturer
himalayan salt lamps
salt lamps
salt lamp

justine9312
Posted: Friday, June 17, 2011 3:02:01 PM
Rank: Newbie
Groups: Member

Joined: 5/23/2011
Posts: 3
Points: 9
Location: US

c++ question

C++ (pronounced "see plus plus") is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features.[2] It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C language and originally named C with Classes. It was renamed C++ in 1983.

Thanks
vodanha89
Posted: Monday, June 20, 2011 9:18:51 AM
Rank: Newbie
Groups: Member

Joined: 6/19/2011
Posts: 1
Points: 3
Location: US

c++ question

google for all answer

come and see my site : ban nha quan Binh Thanh
Users browsing this topic
Guest

 Related
Ultimate Regular Expression Library
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
blue Dots apearing for spaces in the pages
Commerce server 2009 Basket Only Extension
run CS 2007 code on 2009 R2. Where is Microsoft.CommerceServer.Runtime
Error in Unpacking Data warehouse : Cannot connect to Analysis Services version '10.0.4000.0'
Is it possible to do CatalogSearch without any sort property?
using named Instance of sql server in Commerce Server 2009 Datawarehouse
how to Call web service through HTTP
The module 'CommerceProfileModule' depends on the site resource 'Biz Data Service' which does not exist in the Commerce Server a
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Fantora Blog | Discount Shop UK | Discount Shop USA | Discount Shop Canada | Discount Boutique France | Discount Shop Deutschland | Discount Shop Italia | Descuento Shop España

Free Classified ads, Webmaster Forum & Technology Reviews | Fantora Free Classified Ads | Buy & Sell Electronics, Mobile phones & Accessories | fantora Forums Community | Buy & Sell DVD, Games and Consols | Free eBooks & Softwares | SEO & Affiliate Marketing Discussion | Programming Language Forum (.NET, ASP, PHP, SQL) | Free Classified Ads | General Stuff (Movies, Chat, Comics) | Free Online English Movies & Reviews | Free Online Hindi Movies & Reviews | Australia & New Zealand Immigration Forum | Europe immigration forum | Canada Immigration Forum | Ireland Immigration Forum | US Immigration Forum | United Kingdom Immigration Forum

Main Forum RSS : RSS

Powered by: YAF.NET
Copyright © AI Logica All rights reserved.
This page was generated in 0.274 seconds.