program naming convention

Hi all, im an absolute beginner (only installed ubuntu yesterday) and am trying to learn programming in c++ and python in a linux environment for a project I have to do in the future. I have made my first program, a simple hello world, to get to grips with using the g++ compiler and linux terminal but am having troubles running it when I name it in certain ways.

If its named hello, i can type it into terminal, hit enter and get the correct output, that is,

davidbush@davidbush-desktop:~$ hello
Hello, world!

If I name it Hello on the other hand I get
bash: Hello: command not found

but if i use ./Hello I get,

davidbush@davidbush-desktop:~$ ./Hello
Hello World!davidbush@davidbush-desktop:~$

where I get the output but seems to be joined onto the prompt (if its called prompt in linux terminology).

I understand I could just name all my programs in lower case and things should work fine but am just curious as to why this happens. Any insight would be much appreciated. Thanks
hello - system command.
Hello - command doesn't exist
./Hello - run program "Hello" in current dir.

If you want that text from your "Hello, world" program isn't joined with "davidbush@davidbush-desktop:~$" then output newline after "Hello, world!".
Topic archived. No new replies allowed.