char output_char[3500]; memset(output_char,NULL,3500);
//global_var is a short[3050];
memcpy(output_char, (char *)global_var, global_var_length);
i am using memcpy to copy data from one variable to another (the variable im copying over is over 3000 in length), but when i do my program crashes and goes to the address 00000026 (or something similar) when the copy is complete, is the problem here not enough memory? and if it is, how do i allocate more to my program?
What's the value of global_var_length? 3050 or 3050*sizeof(short)? The former will only copy half the source array, but the latter will overflow the destination array.