First of all I'll give a contest as it seems I'm trying to make something inappropriate.
The aim is to add a new line to the array on each iteration of the loop.
The loop is "implied" by "void CMyAppViw::OnLB uttonDown(...)"
I've tried to make it in a number of ways but filed. Here is the recent one:
Eventually here are the questions:
1. how to initialize a global variable in if-loop?
2. how to destroy a variable?
The aim is to add a new line to the array on each iteration of the loop.
The loop is "implied" by "void CMyAppViw::OnLB uttonDown(...)"
I've tried to make it in a number of ways but filed. Here is the recent one:
Code:
int n=1; int array[1][2][3]; void CMyAppView::OnLButtonDown(UINT nFlags, CPoint point) { if (n==1) { calculations(array[],n); } if (n==2) { int temp_array[1][2][3]=array[1][2][3]; //somehow destroy array int array [2][2][3]; //call a function to copy temp[1][2][3] values to array [2][2][3] calculations(array[],n); } n++ }
Eventually here are the questions:
1. how to initialize a global variable in if-loop?
2. how to destroy a variable?
Comment