Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 0.21 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. What happens when you initialize a junk value to something in C?
  2. int main(void) {
  3.    char* ptr;
  4.  
  5.    printf("%cn",ptr[24]);  // junk value
  6.  
  7.    ptr[24] = 'H';
  8.  
  9.    printf("%cn", ptr[24]);  // prints H
  10.  
  11.    return 0;
  12. }