Thank you for saving me Elysia! I'm starting C++ Primer 5th edition
Type: Posts; User: thames
Thank you for saving me Elysia! I'm starting C++ Primer 5th edition
do you mean, almost never ?
c'mon, why do they write books like that then? :frown: I read the ACCU review from your link. It was very disappointing because everything that is written is true.
I read this review before.
I'm almost at the end of Stephen Prata's book (page 830). :frown: At least, I've been learning some principles of C++. He has been using char* and char[] a lot, I...
wha? can you show me a code snippet?
I fixed white. Many thanks!
Cd::Cd()
{
performers = new char[1];
performers[0] = '\0';
label = new char[1];
label[0] = '\0';
how should I do this when it comes to that case, dynamic memory allocation? I used gdb and I think there's garbage inside performers and label when the object is created:
Classic copy;
...
whiteflags can you tell me if I need to define code for those default constructors ?
Classic() {}
Cd() {}
edit:
Stephen Prata coded the operator function that way to get rid of the old data for new memory allocation. After all, I'm renewing the memory space, right?
but whiteflags I've been writing the overloaded operator = that way for another programs and it has been working just fine:
#ifndef DMA_H_
#define DMA_H_
#include <iostream>
class...
Good evening.
thames@semaht ~/C++/Projects/Disks $ g++ -g -Wall maindisk1.cpp disk1.cpp -o maindisk1 -std=c++11
thames@semaht ~/C++/Projects/Disks $ valgrind ./maindisk1
==2721==...