LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2006, 04:57 AM   #1
knockout
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
writting a program


i need help to write this program?



iam a beginner in learning GCC

can u write it in GCC?
Write a C program that will say whether a word has another 3 letter word contained within it.

e.g.

Type in a word: religion
Type in a 3 letter word: eli
eli is part of religion

or

Type in a word: university
Type in a 3 letter word: sin
sin is not part of university
 
Old 04-27-2006, 06:07 AM   #2
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
http://www.linuxquestions.org/linux/...grams_on_Linux



Cheers
Zulfi
 
Old 04-27-2006, 07:05 AM   #3
Spudley
Member
 
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
You'll also want to look up a thing called Regular Expressions, which does exactly what you're asking for (and a whole lot more), and is built into most modern programming languages.
 
Old 04-27-2006, 07:27 AM   #4
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
You can use regex functions available in C for the purpose.

man strstr
Shoudl give you some information

Cheers
Zulfi
 
Old 04-27-2006, 05:18 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If your goal is not to learn C but write simple programs like this, use the bash script language and tools like grep and awk.

Documentation about the bash script language you'll find here

If you want to learn C because you want to learn C, C is a beautiful language, and it is worth learning it.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Writting an OS in C++ makko Programming 2 08-27-2005 07:27 AM
Is a file in writting ? stephnane AIX 3 08-02-2004 11:17 PM
Is a file in writting stephnane Linux - General 2 07-30-2004 09:39 PM
Collaborative writting synna Linux - Software 2 06-25-2004 09:33 AM
Writting my first C program in linux micxz Linux - Software 11 03-14-2003 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:36 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