473,395 Members | 1,616 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.

To get started with C++

Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?

==========
daniel

<a href="http://www.widecircles.com">Link Building</a>
Oct 7 '08 #1
13 1568
da********@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.
Somewhat, at least you know how write and compile programs.
I require it for my job,How many days will it take to learn?
I've been using C++ for sixteen years and I'm still learning.

If you are familiar with C, get a copy of Accelerated C++.

http://www.acceleratedcpp.com/

--
Ian Collins.
Oct 7 '08 #2
da********@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?
Read this:
http://norvig.com/21-days.html
and you might get an estimate how long it should take you.
Oct 7 '08 #3
On Oct 7, 8:29*am, dalbert...@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?

==========
daniel

<a href="http://www.widecircles.com">Link Building</a>
read it for begining...
http://www.cplusplus.com/doc/tutorial/
one of the best site i used... :)
<><><><><><><><><><><><><><><><><>
Andy
Oct 7 '08 #4
http://www.icce.rug.nl/docs/cplusplus/

I like the above site a lot. Especially for someone trying to make a
transition from C to C++, it is quite nice.

Another nice site is http://users.ece.utexas.edu/~adnan/C++/

Both these are ad-free sites, with just pure good quality free
content. I am thankful to the authors of the documents.

BUT, as others have pointed out: one has to practice a lot. I am
trying to make a transition from "C with classes" to C++. It is
gradual, but to begin with these are some things I try to do: use STL
when possible, use references, learn to use const when possible, try
to avoid pointer arithmetic, use the library facilities when you can
rather than reinventing the wheel (that is not quite circular) ...
Sometimes my first version of a program looks a lot like C (and a bit
dirty, although this is not to say C is dirty), but then I make an
effort to clean it up, and simplify it, and often I notice that using
some C++ features, I can simplify the code, make it more readable,
safer, ... I am no expert, so I welcome some experts to comment on
what I have suggested above.

On Oct 7, 4:29*am, dalbert...@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?

==========
daniel

<a href="http://www.widecircles.com">Link Building</a>
Oct 7 '08 #5
da********@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?
Opinions whether a knowledge of C helps learning C++ vary.
I'm in the it-hinders camp. Using C++ as a better C means
missing a huge percentage of its most powerful feature set.
I second the recommendation of "Accelerated C++" by Koenig
and Moo. It's excellent, although it has quite a steep
learning curve. The 2nd edition of Meyers' "Effective C++"
was aimed at former C programmers (the current, 3rd, is
more aimed at converts coming from other languages) and is
a very good 2nd C++ book to read.
Expect to need years, not days, weeks, or months, to become
a good professional C++ programmer. Expect to need weeks or
even months, not days, to become a C++ novice.
Subscribe to some beginner's forum and ask early and often.
There's nothing like discussing your ideas to find out that,
why, and where they're wrong.

HTH,

Schobi
Oct 7 '08 #6
On Oct 7, 11:34 am, Hendrik Schober <spamt...@gmx.dewrote:
dalbert...@gmail.com wrote:
I want to learn C++,I already know C Language,will that help
me.I require it for my job,How many days will it take to
learn?
Opinions whether a knowledge of C helps learning C++ vary.
There are some ways it certainly helps. If you know C, then you
already know how to use an editor to create source code, and
invoke a compiler to compile and link a program. You also have
a grasp of some important basics, like lexical blocks. You know
what a loop is, and what a conditional statement is, and a
function. And if you're not in an English speaking country,
you've managed to figure out how to enter things like { or |
with your keyboard.

Judging from some of the questions we see here, those are
already significant steps. If you know neither C nor C++, and
the goal is to learn C++, then going through C will only take
more time, since you'll have to learn a lot of things which are
irrelevant, or even which should be avoided in C++. But if you
already know C, for whatever reasons, and realize the limits of
applying your knowledge of it to C++, then it can certainly
help.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Oct 7 '08 #7
James Kanze wrote:
On Oct 7, 11:34 am, Hendrik Schober <spamt...@gmx.dewrote:
[...]
> Opinions whether a knowledge of C helps learning C++ vary.

There are some ways it certainly helps. [...]
I know and I agree with your examples.
I was applying my statement to the overall-helpfulness.
I have been teaching C++ and IME those who already know
C (or Java, FTM) need to unlearn a lot of things which
are considered bad habits in C++. Usually, this greatly
outweighed the advantages.
But that's just my opinion, others may have different
ones.

Schobi
Oct 7 '08 #8
you must do small projects in c++ , you create existing applications
in your own way.
you can find a better gui tookit on www.fox-toolkit.org www.fox-tookit.net

c++ is not a better C
it has its own existence. do never follow C coding in C++ . understand
c++ concepts and write
c++ code which includes more than 80% of c++ features.

c++ annotation whic is available free of charge on debian linux OS
will be a good guide

using gnu c++ compiler / other standard comipler

Oct 7 '08 #9
On Oct 6, 11:29 pm, dalbert...@gmail.com wrote:
Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,
How many days will it take to learn?
I agree with others that it will take *years*
to become a good C++ programmer, but that's
true of any other language as well. It's
just truer for C++ since the language is
so incredibly deep, with so many non-obvious
interactions among the various features.

I would suggest reading the books recommended
above, and for help I recommend the Wikipedia
Computing Reference Desk:

http://en.wikipedia.org/wiki/Wikiped...desk/Computing

A number of professional C++ programmers hang
out there, and the desk is focused on giving
good answers to what the questioner probably
meant, rather than comp.lang.c++'s strength
in pointing out the various flaws in question,
grammar, and choice of newsgroup in which to
post.

Sean

Oct 7 '08 #10
anon wrote:
da********@gmail.com wrote:
>Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?

Read this:
http://norvig.com/21-days.html
and you might get an estimate how long it should take you.
This is a great article, since I have being learning and using C++ more
than four years, I still think I'm a more like beginner than an expert.
Oct 7 '08 #11
se*************@yahoo.com ha scritto:
http://en.wikipedia.org/wiki/Wikiped...desk/Computing

A number of professional C++ programmers hang
out there, and the desk is focused on giving
good answers to what the questioner probably
meant, rather than comp.lang.c++'s strength
in pointing out the various flaws in question,
grammar, and choice of newsgroup in which to
post.
Strange thing that nobody in comp.lang.c++ ever pointed out any such
flaws to me when I posted a question here. Instead, I always received
competent and helpful answers, similar to the ones given to the OP in
this thread.

What's more, thanks to the group's strict on-topic policy it's an
excellent archive of C++ information accessible through Google Groups.
Searching for your problem in the archive often renders the question one
was about to ask unnecessary, which in turns helps to reduce repetition
and noise.
--
Christian Hackl
Oct 7 '08 #12
On Oct 7, 2:22 pm, Hendrik Schober <spamt...@gmx.dewrote:
James Kanze wrote:
On Oct 7, 11:34 am, Hendrik Schober <spamt...@gmx.dewrote:
[...]
Opinions whether a knowledge of C helps learning C++ vary.
There are some ways it certainly helps. [...]
I know and I agree with your examples.
I was applying my statement to the overall-helpfulness.
I have been teaching C++ and IME those who already know
C (or Java, FTM) need to unlearn a lot of things which
are considered bad habits in C++. Usually, this greatly
outweighed the advantages.
But that's just my opinion, others may have different
ones.
I think the problem is that C++ looks too much like C. Knowing
one language (should) always help in learning a second, as long
as you only apply what is applicable. The problem in this case
is that many C'isms pass the C++ compiler, and do work. But I
don't like the idea of saying "you have to unlearn them";
they're still valid C. You just have to ignore them when
learning C++. And you can still benefit from the things that do
apply (like how to enter a { or | with a European keyboard).

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Oct 8 '08 #13
In article <4d**********************************@b2g2000prf.g ooglegroups.com>,
<da********@gmail.comwrote:
>Hi folks........
I want to learn C++,I already know C Language,will that help me.I
require it for my job,How many days will it take to learn?
I'd estimate about 3650 days, give or take a few thousands :-(

I second most of the comments given by other posters including some very
good recommended books.

However, you say you need it for your job. IMO, it is possible and
valuable to use C++ simply as a better C.

Some possible steps:

1- Use a C++ compiler to compile all your C files. C++ compilers are
generally more fussy and issue more warnings or even errors on dodgy
practices in particular unsafe pointer practices. Fixed the errors
and warnings where possible. This should improve your code.

2- Learn about const correctness and start using it in your
interfaces. This will be needed once you replace all these pointers
by std::string, std:vector, call by reference, etc. This also leads
to better code.

3- Stop using NULL terminated buffer of characters as "string" data.
Switch to std::string. Much better overall. (and remove strcmp,
strtok, strlen, etc. from your code at the same time)

4- Stop using C-arrays. std::vector is better in the huge majority of
cases.

5- Switch to using the C++ standard library (the STL) as much as
possible.

6- Stop using pointers all the time. References plus the STL remove
the need of pointers in a lot of places and lead to safer code.

7- Initialise all your variables, declare your variables at the point
of use rather than at the start of functions, shorten your functions,
none of that impossible in C but far too often neglected.

By then, you won't have proper C++ code but you should certainly have
cleaner, safer code that is faster to develop.

You can then start working on classes. Often the first thing
introduced in a C++ book but IMO, if you have to adapt quickly on the
job or if you have a significant C code base that is not object
oriented and want to bring in some of the C++ productivity benefits,
C plus C++ STL is a good way to start.

So now, look at where you have a family of functions acting on similar
data. Particularly, where you have

struct TheStruct { ...};
int foo( TheStruct * ts, ...);
int bar( TheStruct * ts, ...);

These are classes.

On the side, when working on new stuff, try to write it in "proper"
C++. Gradually switch to using all the good concepts presented in
these good books that were recommended. Don't ignore exceptions.
Too many C programmers switching to C find exception safety too
complicated and decide to stick with the awkward return error code and
ignore exceptions. C++ has exceptions, the STL has exceptions, even
if you try to ignore them, they are still there. Learn and embrace
them, that will be more productive in the longer term.

Anyway, hope this help and have fun

Yannick



Oct 8 '08 #14

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

Similar topics

5
by: Mark Fisher | last post by:
I have a Java desktop GUI application that the user can run multiple times. In order to keep one instance of the application distinct from another, I'd like to put the instance number of the...
13
by: Deepak Sarda | last post by:
Hello everyone. I have run into something which I believe is a bug or a shortcoming of the threading.Thread module. My program spawns 15 threads. For this I've creating a new class with...
80
by: Bibby | last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: ...
3
by: DAMAR | last post by:
Hello Is it possible to know when a particular process started? For example: I have such situation: I need to know when a notepad.exe is started - i need to get an event of starting this...
0
by: Bob | last post by:
We have an ivr outcall application that starts calling customers at a certain time every day automatically at a predetermined time to advise those expected to receive delivery next day that their...
2
by: bz | last post by:
Hi, I need to detect at runtime if the application was started from VS 2005. Is it possible? Also, how can I know at runtime of app is built for Debug or Release? Thanks
4
by: Benjamin Hell | last post by:
Hi! I wonder whether there might be a way to find out how a Python program was started (in my case in Windows): By double clicking the file or by calling it on the "DOS" command line prompt. ...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.