Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22065

Unable to interpret control operator in linux

$
0
0

I have the following C program saved in a file named 1.c

#include<stdio.h> void main() { printf("Hello World");}

After compiling it, I try to execute it using

./a.out || echo Hi

I expect to see the following output

Hello World

But the output that I get is

Hello WorldHi

The above output seems to be wrong since echo hi should execute only if ./a.out does not get executed successfully. Where am I wrong in interpreting the output?


Viewing all articles
Browse latest Browse all 22065

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>