I have a simple C program and when I compile and run it with ./output, does it get a PID on Linux? (I think, every running program is a process and it should have a PID.)
I used the ps aux command but I couldn’t find the process name there.
I remember, when my console application (a C program) was running on Windows 7, I was able to get its PID via the Volatility tool.
#include<stdio.h>
void main()
{
printf("Hello World!");
}
Yes, every running program on Linux gets a PID.
Your program just prints
"Hello, World!", and will complete so quickly that by the time you runps auxit will have finished.Also,
void main()should beint main(void), and you should add\nto the end of your output string.