I know I can do new char[n] to create an array of n chars. This works even when n is not a compile time constant.
I would like to do something like this in C(99): int n = compute_size_of_matrices(); int T = compute_number_of_matrices();
As Value type variable allocates memory in Stack whereas Reference type allocates it in Heap. So how the memory allocated when a value type variable (e.g. int i = 4;) is declared in the reference type
Okay, so I need to create a 3D data-structure at run-time, I decided to use std::vector, the problem is as follows: I know the dimension of the 1st dimension at instantiation time (when I create the o
#include<stdio.h> #include<string.h> char *y; y=(char *)malloc(40); // gives an error here int main()
Brief Description In a previous post I asked around about a problem with dangling pointers. I understood that I\'m advised to use Boost and I will rewrite my program as soon I fully got the basics ab
These of 2 of the probably many ways of declaring arrays (and allocating memory for them) in c++ 1. int a[3];
I\'m currently cooking up a wrapper container template class for std::vector that automatically creates a multi-resolution pyramid of the elements in its std::vector.
Compact description I\'m having a problem to find out what\'s wrong, for some obscure reason the properties in an object for which I stored the pointer in a vector seem to be changed.
Just out of curiosity, is the following legal? X* p = static_cast<X*>(operator new[](3 * sizeof(X)));