-2

I am getting random characters as output.

Screenshot of Window

Here is my sublime build code:

{
  "cmd" : ["g++ -std=c++14 $file_name -o $file_base_name && ./$file_base_name < inputf.in > outputf.in"], 
  "selector" : "source.c, source.c++",
  "shell": true,
  "working_dir" : "$file_path"
}

Can anyone help me out resolving this?

Mohit
  • 1
  • 1

1 Answers1

0

Your program has written the hexadecimal ASCII codes of the string "Hello World!" into a binary file. That's why you are seeing the hexadecimal format in the editor.

For example, 48 for 'H', 65 for 'e', 6C for 'l', etc.

Take a look at the ASCII table.

digito_evo
  • 3,216
  • 2
  • 14
  • 42