473,385 Members | 1,766 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,385 software developers and data experts.

Learning c, need a little help with compiling.

I am learning c through an online tutorial currently. And I
am running Linux, but the tutorial does not deal specifically
with linux. I'm not sure if I am compiling correctly or not
because I get errors when running the compiled program when
using: gcc hellow_world.c which created a file called hello.cs.
Now for some reason after deleting hello.cs I only get a file
called a.out when I compile which runs with no problems.

What's with the name a.out? From what I read from another tutorial, I was
supposed to get a file called helloworld that I could run, and not this
a.out file.

Thanks for your time,
Michael

Nov 14 '05 #1
4 1448
jester.dev <je********@comcast.net> spoke thus:
Now for some reason after deleting hello.cs I only get a file
called a.out when I compile which runs with no problems.
That's the expected behavior. Whatever hello.cs was, as you've seen
it wasn't needed.
What's with the name a.out? From what I read from another tutorial, I was
supposed to get a file called helloworld that I could run, and not this
a.out file.


The name of the executable depends on how you compile it. If you want
it to be named helloworld, gcc -o helloword your_c_file_name_here.c
would do it.

Before you post further, check out the following links. This group is
for standard C only - Linux things, such as the idiosyncrancies of
gcc, should be posted elsewhere (I suggest comp.unix.programmer).

http://www.csclub.uwaterloo.ca/u/dj3...lc-welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #2
for gcc, it will name the output file as a.out
if u want to name it use the -o parameter
eg
# gcc -o helloworld helloworld.c

enjoy it!

"jester.dev" <je********@comcast.net> ???
news:yaXXb.43512$uV3.84037@attbi_s51 ???...
I am learning c through an online tutorial currently. And I
am running Linux, but the tutorial does not deal specifically
with linux. I'm not sure if I am compiling correctly or not
because I get errors when running the compiled program when
using: gcc hellow_world.c which created a file called hello.cs.
Now for some reason after deleting hello.cs I only get a file
called a.out when I compile which runs with no problems.

What's with the name a.out? From what I read from another tutorial, I was
supposed to get a file called helloworld that I could run, and not this
a.out file.

Thanks for your time,
Michael


~ Let us linux ~
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 14 '05 #3
jester.dev <je********@comcast.net> wrote:
I am learning c through an online tutorial currently. And I
am running Linux, but the tutorial does not deal specifically


This is *completely* off topic, but we're all newbies at some point.

Read the man pages for gcc. Look at example code. Think of a little project
to do in c.

Learn to write Makefiles and autoconf scripts

For gcc, I reccomend the following cmd line options:

-ansi -pedantic -Wall -pipe -O2

As for learning c, there are two books for c u should buy, not borrow:

The C Programming Language (AKA K&R C) - Kerninghan and Ritchie
Efficient C Programming - Mark Allen Weiss

In general the weiss book is good for learning c, and k&r c is good for
reference.

best of luck!

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v' I'm just a normal guy
Nov 14 '05 #4
Thanks everyone for the help. I'll be sure to read through
the FAQ, gcc manual and post in the appropriate group.
The tutorial I'm reading is based on the K&C book, but I
am still going to buy both.

Michael
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: An Ony | last post by:
Hi, I'm just learning c++ with the book from Bjarne Stroustrup and I just type what is in his book into Visual Studio .NET. Is that a good compiler for that or not? I'm beginning to have my...
29
by: Jhon smith | last post by:
Hi,all,I was just wondering if I am likly to have any problems trying to learn C from older books,I have some from the late 80`s,mid/late 90`s. I am using Dev-C++ on the pc windows platform,But I...
25
by: Shawn Ferguson | last post by:
I'm in the process of learning .NET but I have an issue. How do you know what CAN exist. What I mean is how does a person know to use the string.todate or something like that? There are so many...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
26
by: mfasoccer | last post by:
I am sorry if this is an inappropriate place to put this post, if so please delete it. I am wondering about a few things. Do you guys recommend learning C as a second language, as someone who...
9
by: kotori | last post by:
Hi, i'm looking for a C++ compiler that I can run straight off of a USB Thumbdrive for compiling my applications on-the-go. I currently use both dev-cpp and MSVS8 at home, but I desperately need...
10
by: arlef | last post by:
Hi Guys, When learning a language such as C#, would you say it is better to learn the fundamentals using the command-line compiler and a simple text editor such as notepad compared to using a...
4
by: GW | last post by:
Hello, I started to study c# .net today, coming from a background of classic ASP VBScript. I am having an issue with one of my beginner projects, a real simple one too. I have three files: ...
2
by: lmaurer | last post by:
Hi all, I have been charged with learning how to create web pages that will function as data capturing tools. From the research I have done, it looks like I need to learn ASP.net and SQL Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.