C++
Can anyone reccomend any good C++ books (available on amazon preferably). Im not a total newb (I know java, php and vb.net), i just dont know that particular language that well.
A book which covers data structures and concepts too would be beneficial, as im on a comp/sci course atm, and i want to get a head start on next years stuff.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
Well, some mod you are! Don't you see the sticky thread at the top about books? :icon_razz:
A good many of the first shown when you search Amazon look like good prospects, like #4 - C++ for Dummies.
#8 - Starting out with C++, Gaddis is the one I use in my classes. Pretty well written, generally good examples (except I hate his bubble sort example), no major goofs.
ps. It also makes a great doorstop, as most of my students will attest.
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228
Best C++ book I've ever used: C++ Programming: From problem analysis to problem design... by Malik.
Latest Edition
Duki
Nearly a Posting Virtuoso
1,475 posts since Jun 2006
Reputation Points: 817
Solved Threads: 32
Best C++ book I've ever used: C++ Programming: From problem analysis to problem design... by Malik.
That's a good one as well. We used to use that, even before it went into commercial publication.
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228
Well, some mod you are! Don't you see the sticky thread at the top about books
I wanted user opinions and views.
I dont like the style of the "for dummies" books at all.
Accelerated C++ has good reviews, ive heard it mentioned before too. I think im gonna see if i can loan it from the libary.
"Starting Out with C++: From Control Structures through Objects" seems right up my alley in terms of content. Thanks for the reccomendation, vmanes. Its rather expensive though, from amazon uk, (most computer books are 15-25 pounds, this is like 45)
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
> The Complete Reference: C++ from Herb Schildt (1)
> C++ Black Book from Steven Holzner (2)
I'm not good in reviews, but I'll try to give some comments :):
(1) Herb explains everything very clearly and in an understandable way + very detailed explanations, very good examples used in the book and it covers the whole C++ syntax :) ...
(2) This book is also a good one but sometimes it becomes difficult to understand and are there too few examples to demonstrate such an advanced topic :) but to learn to basics it's just a great book, it also covers the whole C++ syntax in detail and might be especially very useful as a reference :) ...
(Both books are written by professional C++ programmers)
> Edit:: C++ Beginner's Guide is also a very nice one (you can get a free legal ebook copy here )
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
Sweet, but sadly im running Linux so i dont think i can view the XPS files.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
>im running Linux so i dont think i can view the XPS files.
1. Look directly below the XPS downloads, and you'll see PDF downloads.
2. FYI: http://www.artifex.com/downloads/
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
Sweet, but sadly im running Linux so i dont think i can view the XPS files.
If you scroll the page a bit down you'll see there's also a PDF version of that ebook available :) ...
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
> Edit:: C++ Beginner's Guide is also a very nice one (you can get a free legal ebook copy here)
I bought that book before the age of 13, and was my first step to becoming the totally awesome programmer you see today :P
William Hemsworth
Posting Virtuoso
1,591 posts since Mar 2008
Reputation Points: 1,429
Solved Threads: 129
Okay ive had a bash at C++, but i have some errors (c++ pointers confuse me...)
#include <iostream>
#include <string>
using namespace std;
class ListNode
{
public:
ListNode(string newData);
~ListNode();
void setData(string newData);
string getData();
void setNext(ListNode nextNode);
ListNode getNext();
private:
ListNode *next;
string data;
};
ListNode::ListNode(string newData)
{
next = NULL;
data = newData;
}
ListNode::~ListNode()
{
}
void ListNode::setData(string newData)
{
data = newData;
}
string ListNode::getData()
{
return data;
}
void ListNode::setNext(ListNode nextNode)
{
*next = nextNode;
}
ListNode ListNode::getNext()
{
return *next;
}
class LinkedList
{
public:
LinkedList();
~LinkedList();
void setHead(ListNode newHead);
ListNode getHead();
void addNode(string data);
void printList();
private:
ListNode *head;
};
LinkedList::LinkedList()
{
head = NULL;
}
LinkedList::~LinkedList()
{
}
void LinkedList::setHead(ListNode newHead)
{
*head = newHead;
}
ListNode LinkedList::getHead()
{
return *head;
}
void LinkedList::addNode(string data)
{
ListNode newNode(data);
head.setNext(*newNode);
}
void LinkedList::printList()
{
ListNode currentNode = *head;
do
{
cout << "Data: " << currentNode.getData();
currentNode = currentNode.getNext();
}
while(currentNode.getNext() != NULL);
}
int main()
{
LinkedList myList;
myList.addNode("test");
myList.addNode("test2");
myList.printList();
return 0;
}
Its supposed to be a linked list btw. The addNode and printList methods are what is broken.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
Okay ive had a bash at C++, but i have some errors (c++ pointers confuse me...)
...
Its supposed to be a linked list btw. The addNode and printList methods are what is broken.
Many of those errors are caused by things like illegal indirections and trying to assign values to members when there's no data allocated.
Remember that when you're trying to access members through a pointer, you have to use the-> operator, but that pointer has to have space allocated. For example, in this function:
void LinkedList::addNode(string data)
{
ListNode newNode(data);
head.setNext(*newNode); // if head is a pointer, then use the -> operator here
}
newNode is not a pointer, so you don't need the * there unless newNode is a valid pointer to a ListNode object.
It would take a while to go through the next 9 errors, so I recommend you revise pointers :icon_cheesygrin:
Hope that helps.
William Hemsworth
Posting Virtuoso
1,591 posts since Mar 2008
Reputation Points: 1,429
Solved Threads: 129
I bought that book before the age of 13, and was my first step to becoming the totally awesome programmer you see today :P
That's the evidence that it's a very good book :P !!
tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
Okay, ive ordered a few books so i will reply when they arrive. Thanks for all your help.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601