On page 53 in C++ Essentials by Sharam Hekmat, it reads
void Error (char *message)
{
static int count = 0; // static local variable
if (++count > limit)
Abort(); //...
}
Well, I don’t get it. What does that mean?
On page 53 in C++ Essentials by Sharam Hekmat, it reads
void Error (char *message)
{
static int count = 0; // static local variable
if (++count > limit)
Abort(); //...
}
Well, I don’t get it. What does that mean?
On page 50 in C++ Essentials by Sharam Hekmat, it gives an example
int error;
void Error (int error)
{
//…
if (::error != 0) // refers to global error
//…
}
in which error is a global variable and in function Error, error is redefined as a local variable. It says ::error should refer to the global error. But it does not work for me. The compiler gives an error message, saying ‘::error undeclared’. How to understand this?
Please refer to the following link for more info.
http://members.gamedev.net/sicrane/articles/iostream.html
my understanding:
<iostream> is for the new compiler and it should be followed by ‘using namespace std;’, like
#include<iostream>
using namespace std;
I am totally new to C++ and just learnt that there are lots of different compile+editor combinations for C++. Well, I just picked one, ‘dev C++’, which is recommended by others.
Dev C++ is a free ware. To download and install, please visit http://www.bloodshed.net/dev/devcpp.html .
The purpose of the blog is to make a note on anything I will struggle with during my learning C++. I will publish some notes on my understanding and questions I will encounter. You are welcome to leave comments and answer my questions.
So far, I am reading C++ Essentials by Sharam Hekmat. This is a thin, compact book, recommended by XYF, who is the other member in out study group.
I also found some other recommendations from the web.
The following books are recommended; read them in mostly the order listed.
Another post
To get started I’d say you go with either C++ Primer from Lippman or Thinking in C++ from Bruce .Eckel
After that, get familiar with the STL.
And I’ve never known a C++ developer who didn’t learn a lot from the books of both
and Herb Sutter:
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!