473,378 Members | 1,375 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,378 software developers and data experts.

Basic C++ questions

1. How many types of copy constructor in C++?

2. Will compiler-generated copy constructor do bitwise or memberwise
copying?
Sep 28 '06 #1
8 2453
webfan wrote:
1. How many types of copy constructor in C++?

2. Will compiler-generated copy constructor do bitwise or memberwise
copying?
Guessing from 2, the answer to 1 is "compiler-generated or
programmer-supplied."

The answer to 2 is "memberwise".

Is this for a quiz or something?

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Sep 28 '06 #2
webfan wrote:
1. How many types of copy constructor in C++?
If you refer to possible signatures, then two.
2. Will compiler-generated copy constructor do bitwise or memberwise
copying?
The latter. What book are you reading that doesn't explain those
basic elements of the language?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 28 '06 #3

1. How many types of copy constructor in C++?

2. Will compiler-generated copy constructor do bitwise or memberwise
copying?
Is homework of you?
Sep 29 '06 #4
Victor Bazarov wrote:
webfan wrote:
>1. How many types of copy constructor in C++?

If you refer to possible signatures, then two.
Actually, it can be more. You can have defaulted
args for the other parameters.
>
>2. Will compiler-generated copy constructor do bitwise or memberwise
copying?

The latter. What book are you reading that doesn't explain those
basic elements of the language?
Nothing trully works "bitwise" in C++. The smallest unit of
operation is a byte.
Sep 29 '06 #5
Ron Natalie wrote:
Victor Bazarov wrote:
>webfan wrote:
>>1. How many types of copy constructor in C++?

If you refer to possible signatures, then two.

Actually, it can be more. You can have defaulted
args for the other parameters.
>>
>>2. Will compiler-generated copy constructor do bitwise or memberwise
copying?

The latter. What book are you reading that doesn't explain those
basic elements of the language?
Nothing trully works "bitwise" in C++. The smallest unit of
operation is a byte.
I think & and | and ^ operators work bitwise in C++. That's why they
are called bitwise.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 29 '06 #6
>>>
Nothing trully works "bitwise" in C++. The smallest unit of
operation is a byte.

I think & and | and ^ operators work bitwise in C++. That's why they
are called bitwise.
But they work on something no smaller than a char.

Actually, with bitfields you can get to smaller items than a char,
but in general bytes are the smallest entity.
Sep 29 '06 #7
Ron Natalie wrote:
Victor Bazarov wrote:
>webfan wrote:
[snip]
>>2. Will compiler-generated copy constructor do bitwise or memberwise
copying?

The latter. What book are you reading that doesn't explain those
basic elements of the language?
Nothing trully works "bitwise" in C++. The smallest unit of
operation is a byte.
I think, under the as-if rule, an implementation is allowed to copy,say, a
char or an unsigned int bitwise as long as it makes sure that at the end,
all bits have been copied :-)
Best

Kai-Uwe Bux
Sep 29 '06 #8
Ron Natalie wrote:
>
>>>>
Nothing trully works "bitwise" in C++. The smallest unit of
operation is a byte.


I think & and | and ^ operators work bitwise in C++. That's why they
are called bitwise.

But they work on something no smaller than a char.

Actually, with bitfields you can get to smaller items than a char,
but in general bytes are the smallest entity.
No bird is as small as a fly-bird. Actually, some fly-birds are as
small, but in general birds are bigger than fly-birds.
Oct 1 '06 #9

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

Similar topics

2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
8
by: Orange Free | last post by:
I want to create a program that will ask a user a series of questions and then generate a Microsoft Word document whose content is dictated by the answers. I am not a professional programmer, and...
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
2
by: Steven O. | last post by:
First, this may not be the correct newsgroup. I have some relatively basic questions on SQL. I tried to find a newsgroup that was specifically just about SQL, and was surprised to find that all...
4
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time...
3
by: Jim H | last post by:
If there is a site someone can point me to that answers such basic questions, rather than taking up support's time posting answers, please let me know. I've developed C# .NET, unmanaged C++, and...
2
by: Fay Yocum | last post by:
BEWARE beginner questions!! I have some experience in Access but never as much as I want or need. I have decided to get in on VB.Net. I would only rate myself in Access as a...
0
by: software2006 | last post by:
ASP And Visual Basic Interview questions and answers I have listed over 100 ASP and Visual Basic interview questions and answers in my website...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
2
by: LayneMitch via WebmasterKB.com | last post by:
Hello. This is a basic quiz. Only about 3 questions. I'm having issue with the answer key which stays on a certain value regardless of acknowledging that you have the correct answer for the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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$) { } ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.