Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Should you dereference function pointers?

Name: Anonymous 2009-11-04 19:33

#include <stdio.h>

void func() {
  printf("hello world\n");
}

void (*go)() = func;

int main() {
  go();    // number 1...
  (*go)(); // or number 2
  return 0;
}


Which is correct ANSI C89? GCC accepts both, even in -ansi -pedantic; it outputs hello world twice.

Name: Anonymous 2009-11-06 19:29

>>28
No, pop() is O(1) from either end obviously. We didn't write it to be faster than STL; we wrote it because we don't *have* STL, because it's for embedded devices (and existing solutions like ustl just plain suck).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List