473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

doubt about ./a.out

Hi All,
When user complile the c file defaulty it creates a.out bin file. Why user needs to run a exe with ./a.out.

please find my obervation below.

It will temperary assign the absolute path name to PATH variable and execute the binary file.

Please let me know, my observation is correct.
Jan 27 '10 #1
5 2010
johny10151981
1,059 1GB
Wrong forum I guess. Try linux or unix forum
Jan 27 '10 #2
RedSon
5,000 Expert 4TB
This is probably a gcc question. I'm not sure what sirdhard is asking about but it might behoove him/her to read a bit more about GCC

http://en.wikipedia.org/wiki/GNU_Compiler_Collection
Jan 27 '10 #3
johny10151981
1,059 1GB
Hello RedSon,
Sorry, I just cant agree with you. This is quite a question, related with linux.

In general case when we try to run a command say
#ping 127.0.0.1

what actually happen?
Linux system find out the path of ping command(more over the executable of ping program) from 2 place
1. /bin
2. /usr/bin/
3. /home/individualuser/bin (not every linux support it)

but think this, say you have created an executable in /home/johny/my_prog/ name a.out

now you are trying to run it.... what you did is
#cd /home/johny/my_prog
#a.out


This wont work at all. cause kernel will look for the program in
/bin/
/usr/bin/
/home/individualuser/bin (not every linux support it)


Not in current directory
so program wont get execute and make an error.
But if you want to run a executable from anywhere in you system do either 2 of these
1. run by entire path. i.e.
/home/johny/my_prog/a.out
2. or change current directory to /home/johny/my_prog/ and then
#./a.out

Regards,
johny
Jan 27 '10 #4
RedSon
5,000 Expert 4TB
Yes what you say is correct.

I interpreted the OPs original question to be about trying to run the object file as an executable. Not a path issue.

If they are trying to run a.out (if it is a file that can be "executed") then they will need to make sure it is on the path or call it directly.

Keep in mind that . and sometimes .. are on the path so you can go to your build output directory and type ./a.out like johny says.
Jan 27 '10 #5
Thanks for all your reply.
Feb 1 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
138
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that...
4
by: dam_fool_2003 | last post by:
I am just a beginner in tree data – struct. I have this little doubt. Left node ‘weights' lesser than the right one. I have seen, so far it is algorithm implementations. But why not vice-versa that...
20
by: maadhuu | last post by:
firstly, i am thankful to all those who answered the 1st set of doubts. And i am not yet enlightened to that extent , coz ' i keep getting doubts. is the following defined in the language ?? int...
3
by: SMG | last post by:
Hi All, It might be a silly doubt, but it is a doubt.... I am using form authentication for my website, now my web application is gonna be deployed on two web servers with Load Balancing...
77
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
11
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
122
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
5
by: Paulo | last post by:
Hi, I have a RadioButtonList and I need to do some verifications on a "OnChange" event on client... because on classic asp/html I just add a "onChange" event on <input type="radio" onChange="">,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.