2020-04-26 05:23:00 +04:00
|
|
|
#include <printf.h>
|
|
|
|
#include <syscall.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2020-04-26 05:35:32 +04:00
|
|
|
int myarray[1000];
|
2020-04-26 05:24:21 +04:00
|
|
|
printf("I'm a C++ program, and I'm running in user space. How about a big, Hello World\n");
|
2020-04-26 05:35:32 +04:00
|
|
|
printf("I'm going to start crunching some numbers, so gimme a minute.\n");
|
|
|
|
for (int i = 0;i < 1000;i++) {
|
|
|
|
myarray[i] = 0;
|
|
|
|
}
|
|
|
|
for (int i = 0;i < 100000000;i++) {
|
|
|
|
myarray[i % 1000] += 1;
|
|
|
|
}
|
|
|
|
printf("Ok, I'm done crunching. Wanna see myarray[0]? It's %d\n", myarray[0]);
|
2020-04-26 05:23:00 +04:00
|
|
|
return 0;
|
|
|
|
}
|