473,836 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

learning Modern C++

hai all,

i am standing on a "crossroad to C++". I am here in front of you as i
have a problem. i will be brief. Please do not think: "arnuld is sick",
i am really struggling & doing hard-work to become a Modern C++
Programmer & i am feeling as if i am standing on a crossroad. i am
asking because every time i made a decision on my own, in my past, i
always ran into huge wastage of time, money & effort. that is why i am
posting it here:

--Problem-- as you folks know that i want to learn Modern C++ & in my
country "C++ Primer" 4/e & "Accelerate d C++" are not available & being
a jobless person i dont have money to order anything from abroad. i
have these books on my shelf:

1.) "Thinking in C++" 2/e
2.) "C++ Primer" 3/e
3.) "The C++ Programming Language" by Bjarne Stroustrup
4.) An illegal version of "C++ Primer" 4/e as a .chm file on my
Desktop.

i have these 5 options:

1.) read "C++ Primer 4/e" online: cant be done. with online copies
productivity goes down to 20%. reading "physically " really makes the
difference in understanding & learning the language.

2.) i took print-outs of 2-3-4 chapters of C++ Primer 4/e & read them &
found them excellent, though i took a while to understand. it has 800
pages, for me, it means 1000 pages of print outs from my EPSON
dot-matrix in 8 separate folders. it will be very difficult to learn
this way & what if i want to search for some phrase/ideas in C++, i am
"gone" in this case. i speak from experience, i tried this with
"Practical Common Lisp" & trust me, it was huge time wastage with much
less productivity & output (well, that is why Stroustrup created C++
:-)

3.) read "Bruce Eckel": tried that, he makes heavy-use of C. i dont
know C, i dont want to, i want C++.

4.) read "C++ Primer" 3/e: utterly incomprehensibl e to me.

4.) Learn C first -OOA & D book -C++. an excellent way to confuse
myself as i have found that learning "vectors, strings, new-delete"
1st, makes learning "C character arrays & free-malloc" much easier.
(while the opposite is not true, i tried it 2 months ago)

5.) Go directly with Stroustrup: +ve point is i will learn "Pure C++",
-ve point is i dont have any real-life coding experience, hence i found
it *too* dense & 50% of the times i did not understand what exactly he
was talink about. (but i do know what are variables, functions &
classes + strings, vectors, new delete from C++)

from all of this, i concluded Stroustrup is the only way to go. i just
need to dwell into it. what do you suggest?

thanks for your time

- arnuld
http://arnuld.blogapot.com

Oct 25 '06
78 4224
arnuld wrote:
>Daniel T. wrote:
>>ok, but what is the difference betwen using /int* x/ & /int x/ as an
argument to a function?

Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.

Ok, you are talking about /arrays/ & /detruction/. so one uses /int*
x/, it means he is using Dynamic-Memory-Allocation instead of Static &
hence faster/efficient use of hardware. right?

/int* x/ refers to /arrays/. what does /int& x/ refers to?
I know it's difficult at the beginning, when you're just starting to
grasp the stuff, but try not to give into developing misconceptions.

Passing 'int*' just means passing an address of an integer, which can
actually be a null pointer. It also can be an address of a real int
variable or an address of an element in an array of int (or even the
address of an imaginary element "one-past-the-end" of an int array).

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 30 '06 #71
Victor Bazarov wrote:
I know it's difficult at the beginning, when you're just starting to
grasp the stuff, but try not to give into developing misconceptions.
ok, but does everyone faces such problems in the beginning?
Passing 'int*' just means passing an address of an integer, which can
actually be a null pointer. It also can be an address of a real int
variable or an address of an element in an array of int (or even the
address of an imaginary element "one-past-the-end" of an int array).
it looks like an approch to solve some problem. so it means, i will get
a better picture by solving some real-life problem.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 30 '06 #72
"arnuld" <ar*****@gmail. comwrote:
Daniel T. wrote:
ok, but what is the difference betwen using /int* x/ & /int x/ as an
argument to a function?
Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.

Ok, you are talking about /arrays/ & /detruction/. so one uses /int*
x/, it means he is using Dynamic-Memory-Allocation instead of Static &
hence faster/efficient use of hardware. right?
One need not use dynamic allocation to warrant the use of int*. For
example:

void foo( int* values, int num )
{
for ( int i = 0; i < num; ++i )
cout << values[i] << " ";
cout << '\n';
}

void bar( int* consumable )
{
cout << *consumable << " consumed.\n";
delete consumable;
}

int main() {
int v[4] = { 10, 20, 30, 40 };
foo( v, 4 );
bar( new int( 12 ) );
}

/int* x/ refers to /arrays/. what does /int& x/ refers to?
int& (when not const) is generally used when the object passed in is
also being used for output. It serves as an alternate way to return
information. The calling code is expected to manage the lifetime of the
object. An example:

void foobar( int& x ) {
cout << "x currently equals " << x << '\n';
x = x + 22;
}

int main() {
int in = 2;
foobar( in );
cout << "'in' now equals " << in << '\n';
}
To send me email, put "sheltie" in the subject.

what is that?
If you want to email me, you can, but you have to put "sheltie" in the
subject of any email you send me. Otherwise my spam blocker will toss it
in the trash.

--
To send me email, put "sheltie" in the subject.
Oct 30 '06 #73

LR wrote:
Noah Roberts wrote:

If it takes you longer than 6 months to learn C++ in its entirety

Is this even a possible goal?
you
may as well just give up and learn Java.

Why? Is it possible to learn Java in six months in its entirety?
If you aren't an expert in Java in 21 days then maybe you're better off
flipping burgers.

Oct 30 '06 #74
"Victor Bazarov" <v.********@com Acast.netwrote:
Daniel T. wrote:
>>
Generally, "int* x" refers to an array of ints or it serves as an
indicator that the called function must take responsibility for the
destruction (calling delete on) the object passed in.

REALLY? <shaking his head in disbelief And I always thought that
it's because the integer needs to be filled in by the called
function, but the argument is essentially "optional". ..
Hmm... Look at your sentence again. The integer *needs* to be filled in,
but the argument is optional? How can the integer get filled in if it
doesn't exist?

I understand that int* can be use when one wants to allow passage of
nothing (i.e., NULL) but that is an extremely rare occurrence in my
experience.
>>why someone should prefer one over the other?

These are primarily minor issues of preference for the programer in
question. If, for example, you now ask between "int* x" and "int&
x" for a single 'x' object, I would have to say, "It depends on the
programer."

Damn! And I thought it depended on the task at hand... Damn!
Really? The only reason references were added to the language was to
facilitate operator overloading (D&E), in every other context where
references are used, one can use a pointer. So then, in those cases
where a reference can be used (other than operator overloads,) it is
purely a matter of programmer preference between use of a reference or a
pointer. I personally use pointers to indicate the passing of ownership
and reference when the called function doesn't want to accept ownership,
but that's just a style of mine, nothing in the language requires it.

--
To send me email, put "sheltie" in the subject.
Oct 30 '06 #75
Victor Bazarov wrote:
Since open source projects are not widely known by commercial companies,
having contributed to any of [potentially very obscure] OS projects may
not give you what you expect. Have you asked if OS projects will be
good enough for a company to consider it "experience "?
no, i just did a search on www.monsterindia.com. now, i will look for
email addresses of their "hiring managers" & will ask them.
As to not getting a job, have you tried talking to a recruiter? They
usually know much more of how to succeed in job seeking.
i live in a Town.no recruiters are here. i can go to a city but one is
at least 120km away & others are at least 370 kms. i will check if
anyone available online for the cities where there is an opprtunity to
work.
Prioritise your goals.
1.) [..book titles redacted..]


We'll call the above "learn enough C++ to get a job". Subgoals are
good to have.
5.) step 3 & half of 4 will take at least 6 mothst to 1 year.

That's not a goal. That's a risk.
did not get it.

Oct 30 '06 #76
arnuld wrote:
>[..]
>>5.) step 3 & half of 4 will take at least 6 mothst to 1 year.

That's not a goal. That's a risk.

did not get it.
What didn't you get? Are you setting a goal to spend a particular
amount of time on those? I see a statement saying "blah will take
so an so much time". That's called "risk assessment". Basically
you say, "We have time delay here before the task is complete; the
longer the delay, the more shit can happen and alter our universe,
so, the more time we allocate, the more risk we're taking (in shit
happening)". What goal are you setting here? Not to allow shit to
happen? You can't. You have very little influence on that (if at
all).

If you intended to limit yourself to a certain study period, then
you need to rephrase. Something like "spend no more than 6 months
on this before re-evaluating the list of goals", and make it part
of the goal describing studying. There has to be a set of
measurements that would help you understand whether the task has
been accomplished. Like, "I finish all exercises in book A and
50% of exercises in book B successfully". Or, "I join an open
source project and fix two bugs satisfactorily" . Otherwise, how
do you know you reached your goals?

We seem to be going waaaay off topic here. Perhaps you need to
get a copy of "management 101" textbook (or some such). That's
where they teach proper processes for setting goals and verifying
hitting them, and reviewing them, and...

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

arnuld wrote in message
<11************ **********@e3g2 000cwe.googlegr oups.com>...
>Victor Bazarov wrote:
>I know it's difficult at the beginning, when you're just starting to
grasp the stuff, but try not to give into developing misconceptions.

ok, but does everyone faces such problems in the beginning?
No, because most of us read a book [1] instead of arguing on an NG!! :-}

Try:
'You Can Do It!' and "You Can Program in C++"
see http://www.spellen.org/youcandoit

Try some code. When you expect it to do "ahh", but it does "duh", and you
want help, this is the NG to consult.

[1] - ...the WHOLE book!!
example: In "Thinking in C++", Mr.Eckel will often show you how to do
something, but explain it much later in the book. You don't have 'the big
picture' until you hit the last page.
--
Bob R
POVrookie
Oct 30 '06 #78

"Victor Bazarov" <v.********@com Acast.netwrote in message
news:ei******** **@news.datemas .de...
arnuld wrote:
>>Greg Comeau wrote:
>>No. That would be unreasonable. But it would not be unreasonable
to expect a novice to:

1) Get more than one text
2) Be expected to read and reread paragraphs, sections, chapters
3) Go back to earlier chapters for info they didn't grasp first time
4) Try many of the examples gives by the author.
5) Try many of the exercises suggested by the author.
6) Spend hours and hours on it.
7) Take it slow
8) Understand that a tour of something is not necessarily a novice
description

YES, i am doing it now. i think i was not *hard* on myself. IOW, i was
not working hard enough. it is only because of Folks here /Stroustrup'
book/ that i have not lost hope, hence i took "4-5-6" onto me. but
will "7" not increase my learning-time to years?

It will. So? Many of us who use C++ professionally do not get to
employ all possible features of it in our daily programming/design.
"do not get to"? Well, then you're a well-managed project then maybe
(read, someone enforces a coding standard, which of course should
indicate what C++ features will be allowed and how). I'm being facetious
because I don't believe anyone does that (the C++ feature leash thing)
(?), but I believe such a thing
would be not only good, but a boon (whatever a "boon" is!). The most
recent enlightening thing I've found was the coding standard that
B. Stroustrup's website has on it. That I'm going to reread every few
months until every good idea in it is in my own codebase.

So a coding standard like that is good, but controlling the zeal of
programmers that want to do magical stuff with the C++ mechanisms is
even more important. Someone is going to have to maintain that code
afterall, and many times it is not its creator. The concept of
"C++ on a leash" is a good one IMO.
That means many parts even when "learned" first, tend to slip away
and need to be re-learned years later, thus stretching the learning
curve significantly.
Those are probably the things that should be in the exclusion list!
It is unrealistic to learn _all_ of C++ in less than a year (and have
a life at the same time).
C++ is a smorgasbord, eat what you like.
You cannot become an expert without
actually doing the stuff.
That sounds like a focus on the intricate mechanisms rather than an
applied focus (actually building something simple and elegant).
And if you are doing it, you just don't
have enough hours in a day to do it all during one year (*and* have
a life)... So, either you give up living a normal life (which you
shouldn't) or you give up hope in becoming an expert in too short of
a time. I chose the latter. I am still learning.
Personally, I think there are enough "language lawyers". How many are
really needed?? The names read like the C++ books at Borders. On my
shelf is Stroustrup, Coplien, Meyers, Koenig/Moo... and I've spent a lot
of time reading many passages of books at Borders.

I'll leave the above paragraph there, but now that I'm thinking about it,
I don't think I'd be able to afford any of those people to act as a lint
tool on my products' code before release. So yeah, there's probably a
lot of those kinds of people needed. Or some fancy tool from Parasoft?
I believe they had a tool that analyzed code for Meyer's "Effective C++"
best practices, yes?

Tony
Dec 13 '06 #79

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

Similar topics

3
330
by: kooolega | last post by:
Hi, that's me! I've decided to learn C++, but I'm still thinking about the books about C++. Which one is the best one and so on. I've made a list of books I'm going to read. I'd be glad if you checked it and told me your opinion. So, that's the list: 1. "Thinking in C++. Tom I" by Bruce Eckel 2. "Thinking in C++. Tom II" by Bruce Eckel and Chuck Allison 3. "C++ Unleashed" by Jesse Liberty 4. "C++ Gotchas: Avoiding Common Problems in...
3
2573
by: Sean McCourt | last post by:
Hi I am doing a JavaScript course and learning from the recommed book (JavaScript 3rd Edition by Don Gosslin) Below is one of the exercises from the book. I get this error message when I try to use the calculator. "document.Calculate.Input is null or not an object" Can someone please tell me why this is?
8
1970
by: Mantorok | last post by:
Hi all I'm looking to learn C and/or C++ and I was wondering if there were any good on-line resources and books. I am currently a C# developer but I'm keen to discover C/C++ as I feel it would be a benficial experience. Any suggestions?
4
1822
by: AmateurScripter | last post by:
I'm interested in learning C. What is the best way to learn this language? I know some JavaScript and know HTML very well. I can't afford any programs, but I can get books. What should I do?
26
3677
by: puzzlecracker | last post by:
It'd be interesting to compare the learning practices of c++ practitioners. I'll start with mine The C++ Programming Language C++ Primer Effective C++ More Effective C++ Effective STL The C++ Standard Library : A Tutorial and Reference (most of it) Exceptional C++
14
1659
by: master_programmer | last post by:
Hi I hope that I am posting to the right place. I want to learn programming and am looking at a language too choose. I thought about C++ but my friend told me thats its old fashioned and will be replaced by more modern computer languages like Visual Basic and Cold Fusion. Is it true that not many people use C++ anymore? What is the best language to learn?
3
1461
by: Niv | last post by:
Hi, I will shortly need to learn C or C++ as a high level hardware description language, modelling hardware at a more abstract level than VHDL. (I'm competent at VHDL & semi-competent at Tcl). I've done some minor dabbling in C before, but should I now, assuming I'm starting out afresh, start with C or go straight to C++. Will C give me a good grounding for C++ or add to my (likely) confusion? Regards, Kev P.
0
9814
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10544
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10585
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7788
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6977
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4447
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3111
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.