Muszę użyć profilera. Kod jest odgórnie narzucony. Napotkałem problem, bo nie wiem, co zmienić, żeby działało. Visual Studio podpowiada, ale nie jestem w stanie każdy błąd poprawić. Prosze o pomoc
#include <ctime>
#include <cstdlib>
#include <iostream>
#define TAB_SIZE 1000
void fillTable(int tab[]){
int i;
srand(time(0));
for (i=0; i<TAB_SIZE; i++)
tab[i] = rand() % 1000;
}
int compareInt(const void* num1, const void* num2){
if (*(int*)num1 < *(int*)num2) return -1;
else if (*(int*)num1 > *(int*)num2) return 1;
else return 0;
}
void sortTable(int tab[]){
przypadek 2 - quick sort
//qsort(tab, TAB_SIZE, sizeof(int), compareInt);
}
void displayTable(int tab[])
{
int i;
for (i=0; i<TAB_SIZE; i++)
std::cout<<tab[i]<<std::endl;
}
void test1()
{
int tab[TAB_SIZE];
fillTable(tab);
for(int i=0; i<1000; i++){
sortTable(tab);
}
displayTable(tab);
}
int doSomething(){
do something ... some calculations
for( int i = 0; i < 100000000 ; i++ ){
int a = 100;
int b = 2 + a ;
int c = a + c * c + a * a;
}
}
int main(){
srand(time(NULL));
test1();
doSomething();
std::cout<<"\nWcisnij dowolny klawisz...\n";
getchar();
return 0;
}