Skip to content

Instantly share code, notes, and snippets.

@orontee
Created September 25, 2013 14:25
Show Gist options
  • Save orontee/6700387 to your computer and use it in GitHub Desktop.
Save orontee/6700387 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstring>
const int ARRAY_SIZE = 2000;
int main()
{
float *const a = new float[ARRAY_SIZE];
std::memset(a, 0, ARRAY_SIZE * sizeof(float));
std::cout << sizeof(char) << " " << sizeof(float) << '\n';
std::cout << a[0] << a[1] << a[2] << "..." << a[ARRAY_SIZE - 1] << '\n';
delete[] a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment