Q:

Unexpected output while reading from file

I am using code from cplusplus.com, which is opening file, reading info from it, print it, and then close it. So, here is the code:
#include <iostream>     // std::cin, std::cout
#include <fstream>      // std::ifstream

int main () {
  char str[256];

  std::cout << "Enter the name of an existing text file: ";
  std::cin.get (str,256);    // get c-string

  std::ifstream is(str);     // open file

  while (is.good())          // loop while extraction from file is possible
  {
    char c = is.get();       // get character from file
    if (is.good())
      std::cout << c;
  }

  is.close();                // close file

  return 0;
}

So, file with this code is called "prog.cpp", and saved in Documents/Test folder. In the same folder I have text file, called "hello.txt", which consists of following:
hello to everyone

So, after I run my program, expected outcome is "hello everyone", but I have:
hsdhs131313dhhsd

So, there is no other files. Where is the mistake? What have I done wrong? Using mac os x.
Here is the screenshot of termianl window, sublime text window and finder. Thanks in advance for help

A:

When the program asks for the name of a file, enter the full path:
Enter the name of an existing text file: /Users/ratkke/Documents/Test/prog/hello.txt

