struct Foo
{
int* data;
};
void DoStuff(const Foo& f)
{
f.data[3] = 10;
}
int main()
{
int buffer[5];
Foo f;
f.data = buffer;
DoStuff(f);
return 0;
}
Last active
July 26, 2022 23:53
-
-
Save erincatto/94d82f0140a3d48849483134f3efce21 to your computer and use it in GitHub Desktop.
const correctness
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment