LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-15-2007, 08:40 AM   #1
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246
Blog Entries: 1

Rep: Reputation: 31
Smile Help/Assistance learning C.


Hi ppl,

I was thinking of a thread for discussing small program examples
for helping out newbie programmers like me.
Noobs submit their program examples here and if experts have the time,
they can go through those and tell the shortcomings or potentially harmful side effects of the code while suggesting improvements.

The programs will b simple and well-commented hopefully.

If the experts approve of this plz let me know.
 
Old 02-15-2007, 09:08 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I don't know that I'm an expert, but my thought is that there is already such a form. It's this programming forum right here. Play around with C, and if you have a question, come back and ask it.

Hope this helps.
 
Old 02-15-2007, 09:31 AM   #3
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
I've found that having a blog and posting code examples to it to be very helpful - I've had a lot of useful comments left about the C code I write as I learn..
 
Old 02-15-2007, 10:22 AM   #4
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
I think that wjevans_7d1@yahoo.co is on the money.
Just get stuck in.

When you have something specific to ask just put it into the programming forum.
Thats what I do.!?


Good Luck.
 
Old 02-17-2007, 10:33 AM   #5
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Thats OK. Thnx for the support.
Could u suggest some small open source program which I can take a peek into to see what real world C-programming is like? Beginner stuff, plz.
 
Old 02-17-2007, 05:30 PM   #6
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
i think without knowing file input/output, a program isnt very useful.
so (unless you do already), learn the basics of C.. basic console input/output, and datatypes. once you know that, then start learning basic file input/output.. an example program would be the 'cat' command, which just opens a file and displays every character until it reaches the EOF/-1 character, printing each one at a time.

good luck!
 
Old 02-18-2007, 06:46 AM   #7
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246

Original Poster
Blog Entries: 1

Rep: Reputation: 31
thnx. I got the basics of C.
Just wanted 2 see some real world C.
 
Old 02-18-2007, 09:25 AM   #8
mihirsevak
LQ Newbie
 
Registered: Feb 2006
Location: Florida, USA
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
Real world C

Real world C is just a language (programming tool). You might want to understand Data Structures and Algorithms very well. Programming is more of a logic development and problem solving techniques.
On the other hand I can't suggest any other open source software then linux. Pick one perticular area and study it deeply. i.e. memory management, file system handling, network processing..anyone of them. It would be a great experience.

I hope this will help.
And yes anytime you are stuck or you need suggestions This forum is always there.
-Mihir.
 
Old 02-18-2007, 09:35 AM   #9
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
Originally Posted by ciden
thnx. I got the basics of C.
Just wanted 2 see some real world C.
check out sourceforge and use the project filter using the language option.
 
Old 02-18-2007, 01:58 PM   #10
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
It ain't all pain. Check this out:

http://www.gnu.org/fun/jokes/helloworld.html
 
Old 02-23-2007, 07:19 AM   #11
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Thanx ppl.
Plz suggest an example to learn date and time functions for incorporation into other programs.
 
Old 02-25-2007, 11:47 AM   #12
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246

Original Poster
Blog Entries: 1

Rep: Reputation: 31
wats the equivalent of DOS.h & GRAPHICS.h in linux?

I have previously used the headers GRAPH.h and DOS.h
in my C programs on MS-DOS.
There should be an equivalent of DOS.h in linux but could not find in /usr.
Is it called something else in linux?
 
Old 02-25-2007, 03:38 PM   #13
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by ciden
There should be an equivalent of DOS.h in linux but could not find in /usr.
Why should there? Linux isn't based on DOS.

However, there are approximate equivalents to some of the dos.h functions in the Linux header files. What specifically do you need from there?
 
Old 02-25-2007, 04:01 PM   #14
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
Quote:
Thanx ppl.
Plz suggest an example to learn date and time functions for incorporation into other programs.

example of date and time usage.
Code:
 printf("Grabbed packet of %d bytes in length.\n",hdr->caplen); printf("Recieved at %s\n",ctime((const time_t*)&hdr->ts.tv_sec));
its the printf function that contains the pertinent stuff 2 your question. see
Code:
 man ctime.

Last edited by slzckboy; 02-25-2007 at 04:02 PM.
 
Old 02-27-2007, 10:27 AM   #15
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Well, Thnx.
I wanted to use the date and time functions. Got it now.
ctime it is.


My friend had made a nice calendar program using GRAPHICS.h
to draw rectangles and stuff in MS-DOS. Thats y I was asking.


As for "linux NOT based on DOS",
isnt DOS just Disk Operating System?
wouldnt it be proper to call Unix or linux as DOSs?
I dont know bout that, plz tell.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
assistance required v.s.sankar Linux - Certification 4 05-02-2006 08:01 AM
Need assistance please wennie Linux - Software 5 03-16-2005 07:24 AM
Need assistance spotslayer Linux - Software 1 11-18-2004 06:49 AM
IMP assistance ravinmiist Slackware 1 09-19-2003 04:18 PM
Need Assistance Bizar Slackware 11 06-25-2003 09:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration