Name: Anonymous 2009-10-31 17:31
#include <iostream>
int *modi (int *array)
{
int *start = array;
for (int x = 0; x < 10; x++)
{
array[x] = x;
}
return start;
}
int main ()
{
int arr[10] = { 0 };
for (int x = 0; x < 10; x++)
{
std::cout << arr[x];
}
modi (arr);
for (int x = 0; x < 10; x++)
{
std::cout << arr[x];
}
std::cout << "niggers";
return 0;
}So I just wrote this. I know what it does, and I know that it works, but I don't know how it works.
int *start dereferences, but the value is undefined, and oh god how the fuck did I make this compile.
Please help.