convert without using strtol


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
convert without using strtol

Hi I need help with some function. I have to fetch data from stdin without using of scanf() (I have to use getc or getchar) and then each sign I want to convert to another sign - here I can't use function strtol Smilie . In the end i want to print this string to stdout without using of function printf (I have to use putc or putchar)

Thank all very much fot each idea
# 2  
Alarm bells start ringing when you hear the two terms "...I have to write..." and "... it cannot use ..." when no logical reason is given for either and the feature being denied is arbitrary.

Last edited by porter; 09-24-2007 at 08:58 AM..
# 3  
Sorry for my inaccurate information. This is my first topic in this forum...
I add more informations.
The function should convert for examle number 30 to sign "." number 31 to next sign in ASCII table...
# 4  
Homework?

1. atol

2. sprintf/write
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #729
Difficulty: Medium
BASIC stands for Basic All-purpose Symbolic Instruction Code.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Convert

my file or content of the file looks like this: HR-BUSPARTNET SC-POINQUIRY BATCH FIN-CHOPDATARESTRICT HR-DATABASEACCESSNOEXEC GL-EXTINQ RSS SC-APPROVER ESS all said and done, i'd like to have it look like this: ... (6 Replies)
Discussion started by: lawsongeek
6 Replies

2. Shell Programming and Scripting

how to convert this to a loop

I have a list of files in the same directory need to do the following cut -d "=" f2 file1 > file1_result cut -d "=" f2 file2 > file2_result ... past file1_result file2_result .... >file_sum How to do this in a loop? Thank you. (3 Replies)
Discussion started by: ksgreen
3 Replies

3. Shell Programming and Scripting

Convert / to \

Hi, In my input variable values are c:/test/sample/ I need to convert it to c:\test\sample I need to find and replace it How do I do it? var_conversion=`"$var_SearchFile" | sed 's/'\'/'/'/g'` echo ${var_conversion%/*} My code throws error (4 Replies)
Discussion started by: magesh_bala
4 Replies

4. Shell Programming and Scripting

Convert into C program

Hi, in this forum I was able to find a logic written by perderabo to write packed decimals. the code works fine. However, I would want to convert it to a c program. so as to do that I am not able to understand the below mentioned logic. Can someone please help me understand that? if... (0 Replies)
Discussion started by: hitmansilentass
0 Replies

5. Shell Programming and Scripting

Convert timezone

Hi, I have date with my server's timezone. I want to convert it with another timezone either EST or GMT, found Date:Manip module but cant find exact use, can anyone help... (4 Replies)
Discussion started by: darshakraut
4 Replies

6. AIX

time convert

Hi Friends, I see the last login time as time_last_login=1210762918 How to convert this to standard format. I believe there is a command, I am not able to recollect it. Thanks in advance (10 Replies)
Discussion started by: b_manu78
10 Replies

7. Shell Programming and Scripting

help to convert

how to convert this perl expression to Python while (<FIL>) { s/+/ /g; if (/<DOC\s+doc_ID=\"(.*?)\".*sys_ID=\"(.*?)\"/i) { #" ${$$hashptr{$sys_Id}}{$doc_Id} = $docstr; # push(@$doclistptr, $doc_Id); $doc_Id = $1; $sys_Id = $2; $docstr = ""; ... (1 Reply)
Discussion started by: jaganadh
1 Replies

8. Shell Programming and Scripting

convert to GB

hello, my objective is to calculate the swap size -bash-3.00# swap -l swapfile dev swaplo blocks free /dev/md/dsk/d1 85,1 8 33559776 16966160 so size=blocks*512/(1024*1024*1024) since blocks are 512-blocks any idea how to get it? so far I was able to... (6 Replies)
Discussion started by: melanie_pfefer
6 Replies

9. Shell Programming and Scripting

here-doc convert 2 script convert to single script?

I have my main script calling another script to retrive a "ls -alt" of a directory that's located in a remote location I'm sftping into. main.sh #!/bin/ksh getLS.sh > output.txt getLS.sh #!/bin/sh /home<..>/sftp <host@ip> <<! cd /some/dir/Log ls -alt quit ! Basically I'd like to be... (2 Replies)
Discussion started by: yongho
2 Replies

10. UNIX for Dummies Questions & Answers

To convert

Hi, I have a source file with 'Aug 1 2004' kind format. I need to search the records with certain period, like from Aug 1 2004 to Sep 20 2004. Can someone give me some ideas what I should start with? ThanX !! (1 Reply)
Discussion started by: whatisthis
1 Replies

Featured Tech Videos