Description:
The object-oriented C++ language.
|
|
|
===Welcome to comp.lang.c++! Read this first.
|
| |
Welcome to comp.lang.c++! Read this first. This post is intended to give the new reader an introduction to reading and posting in this newsgroup. We respectfully request that you read all the way through this post, as it helps make for a more pleasant and useful group for everyone. First of all, please keep in mind that comp.lang.c++ is a group for discussion... more »
|
|
Leaking Memory
|
| |
Will this code leak memory? I hope I deleted the array correctly. ...using namespace std; int main() { //integers n and m represent the field //n is rows and m is columns int n = 5, m = 5; int** field = new int*[n]; for(int i = 0; i < m; i++) field[i] = new int[m]; for(int i = 0; i < n; i++)... more »
|
|
Should Singleton instance be destructed after its usage
|
| |
The following question is NOT a homework problem. I am asking it for learning purpose only. Suppose I have a Singleton class and I have created an instance of the Singleton class. Now, after the usage of the Singleton instance, should the instance be deleted ? If it should be deleted, which of the following two versions of deleting the Singleton instance should be... more »
|
|
Detect overflow by reading ALU's carryout
|
| |
Hi all! I'm writing a piece of code that will cycle thousands of thousands of times. Within the cycle I perform an addition of two unsigned ints. I need to be able to read the carryout bit (signal or flag) from the CPU/ALU. I cannot use another math operation just to detect if there was an overflow, because timing for this algorithm is... more »
|
|
interesting pointer cast problem
|
| |
There are several ways to build 2D array in C++. Usually I do it using following code: // ============================== ========== int rows = 10, columns = 10; int *array1d = new int[rows*columns]; int (*array2d)[columns] = reinterpret_cast<int (*)[columns]>(array1d); /* Now we can use array2d like this - array2d[i][j] */... more »
|
|
Agile Methodology for Embedded Systems
|
| |
One of the most popular methodologies of embedded software development is Agile methodology. It is widely used by software companies to develop embedded products based on requirements sent in by the client at different points of time. Here, different iterations of the embedded products are developed based on different sets of client... more »
|
|
C++0x question: Range-based loop and auto
|
| |
With the next standard it will become possible to write eg. for(int& value: someContainer) { someFunc(value); } However, would this be valid as well: for(auto& value: someContainer) { someFunc(value); } ? That would be useful if the element type is complicated or unknown. --- news://freenews.netfront.net/ - complaints: n...@netfront.net ---... more »
|
|
Converting CHAR_MAX+1 to char?
|
| |
What happens in this case? char c = CHAR_MAX + 1; Not sure what happens. The spec only defines behavior for signed and unsigned integral types it seems. Is the behavior undefined?
|
|
|