T
thomas
Hello suppose I have simple class like this :
/*++++++++++++++++++++++++++++++++*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Array { // klasa array pamieta 10^8 elemntow char oraz
//tablice "tablica" wskaznikow do slow zbudowana z nich
char memory [10000000];
char** tablica;
string current;
int n;
int i; // bierzaca pozycja w tablicy memory
int length;
};
/*+++++++++++++++++++++++++++++++++++*/
now somwhere in main I declare :
main(){
Array A;
}
when I run program it crushes.
but when I do call like that :
main(){
Array A = new A();
}
everything works fine.
I use gcc3.4 on windows xp. Is it something linked with the system memory
allocation ? (in this two case at every time the piece of memory will be
declared in diffrent memory segment : once at data and second time at stack,
but have no clue why it behaves like that).
/*++++++++++++++++++++++++++++++++*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Array { // klasa array pamieta 10^8 elemntow char oraz
//tablice "tablica" wskaznikow do slow zbudowana z nich
char memory [10000000];
char** tablica;
string current;
int n;
int i; // bierzaca pozycja w tablicy memory
int length;
};
/*+++++++++++++++++++++++++++++++++++*/
now somwhere in main I declare :
main(){
Array A;
}
when I run program it crushes.
but when I do call like that :
main(){
Array A = new A();
}
everything works fine.
I use gcc3.4 on windows xp. Is it something linked with the system memory
allocation ? (in this two case at every time the piece of memory will be
declared in diffrent memory segment : once at data and second time at stack,
but have no clue why it behaves like that).