Hey, I am having trouble with some code. Reduced to just this there still is an error:
Code:
int main () {
//************ MAIN PARAMETERS ******************//
#define dictionary_length 1000000
#define input_word_max_length 20
#define num_of_neurons 1000000
#define num_of_connections_per_neuron 4
//************************************************//
char dictionary_words[dictionary_length][input_word_max_length];
int inputs[dictionary_length];
int outputs[dictionary_length];
float *brain_energy[num_of_neurons][num_of_connections_per_neuron];
float energy[num_of_neurons];
unsigned int *brain_conn_strength[num_of_neurons][num_of_connections_per_neuron];
unsigned int conn_strength[num_of_neurons*num_of_connections_per_neuron/2];
printf("A");
return 1;
}
It compiles fine but when run (in XCode) it throws an error pointing to the printf statement saying "Cannot access memory at address 0xbbf25e74" (the address changes from build to build).
Any idea what is going on here. I have heard allocating using malloc manually is the way to go, but would that solve this problem?
Any ideas would be appreciated
Thanks!