LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-11-2004, 12:17 PM   #1
ej25
Member
 
Registered: Nov 2004
Posts: 39

Rep: Reputation: 15
Captlization


hi every body
I have problem with my programme that open file and display it with numbering each line in the file.(like cat -n)

I open the file and I display but how can I number the lines?how do I check when a line is finsh?

also, Do any body know how to captlize the letter in a file without using toupper() command?
 
Old 11-11-2004, 12:55 PM   #2
phoenix7
Member
 
Registered: Aug 2004
Distribution: Mandrake 10.2(Mandriva), SuSE 9.3, Slackware 9.1, Xandros 3.1, Knoppix 3.9, FreeBSD 5.3, RedHat9
Posts: 122

Rep: Reputation: 15
you can convert a char from lower case to upper using this :
Code:
c = (c >= 'a' && c <= 'z') ? (c - 'a' + 'A') : c;
what function do you use for working with files??
 
Old 11-11-2004, 01:30 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Re: Captlization

Quote:
Originally posted by ej25
I have problem with my programme that open file and display it with numbering each line in the file.(like cat -n)
Is this in C, bash, PHP, python, perl.... ?
Is this your homework?
 
Old 11-11-2004, 03:35 PM   #4
phoenix7
Member
 
Registered: Aug 2004
Distribution: Mandrake 10.2(Mandriva), SuSE 9.3, Slackware 9.1, Xandros 3.1, Knoppix 3.9, FreeBSD 5.3, RedHat9
Posts: 122

Rep: Reputation: 15
that was C code.
 
  


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



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

All times are GMT -5. The time now is 09:56 AM.

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