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

Untitled

By: a guest on May 5th, 2012  |  syntax: C  |  size: 0.36 KB  |  hits: 15  |  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. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. int main () {
  7.     char* line = "test line";
  8.     char* newLine;
  9.  
  10.     newLine = line;
  11.  
  12.     printf("line is: %s\n", line);
  13.     printf("changing newLine\n");
  14.  
  15.     newLine = "changed line";
  16.  
  17.     printf("newline is: %s\n", newLine);
  18.     printf("original line is: %s\n", line);
  19.  
  20.     return 0;
  21.  
  22. }