project

can any one please give me a simple program which includes array function and graphics
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

using namespace std;

int main()
{

cout << "No.\n";
return 0;

}

edit: I did this because, I realize that we really shouldn't just GIVE free programs... maybe reference some places that could help with code though.
Last edited on
That already includes an array (char array, with std::string wrapped around) and a function call in form of the overloaded left shift operator.
Last edited on
ok, 1st, Little Quick that is NOT an array or graphic program
2nd, this is a array only program:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
void quickSort(int arr[], int left, int right) {
      int i = left, j = right;
      int tmp;
      int pivot = arr[(left + right) / 2];
 
      /* partition */
      while (i <= j) {
            while (arr[i] < pivot)
                  i++;
            while (arr[j] > pivot)
                  j--;
            if (i <= j) {
                  tmp = arr[i];
                  arr[i] = arr[j];
                  arr[j] = tmp;
                  i++;
                  j--;
            }
      };
 
      /* recursion */
      if (left < j)
            quickSort(arr, left, j);
      if (i < right)
            quickSort(arr, i, right);
}
Graphics? Which library are you going to use?
Oh, come on, really? I understand what LittleQuick was trying to do there: type his response in code.

Aside from that, regarding the graphics (arrays have already been covered), that very much depends on what library or API you'd like to use. A lot of us might recommend SFML, but any preference?

-Albatross
Last edited on
Topic archived. No new replies allowed.