LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-05-2007, 04:40 AM   #1
Chocolate
LQ Newbie
 
Registered: Nov 2006
Posts: 23

Rep: Reputation: 15
reading as ASCII


hello,
i have a problem in coding.

the input_file:
Doc1: 1 0 1 0

the code file:
i read the input file and put the vectors in an array.
however instead of puting 0, it was reading it as its ASCII (48), and 1 as (49).

thanks alot.
 
Old 05-05-2007, 04:57 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
how can we help you without any code to look at??
 
Old 05-05-2007, 06:52 AM   #3
elsheikhmh
Member
 
Registered: Aug 2004
Location: Cairo, Egypt
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
You can easily convert it to the corresponding integer by subtracting either 48 or '0' (not sure about your programming language).
-Mustafa
 
  


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
[bash] ASCII to HEX and hex to ascii ////// Programming 17 05-08-2018 09:55 PM
tiff to ascii? pwc101 Linux - General 1 12-08-2006 02:29 PM
ASCII C Help, Please InvisibleSniper Programming 33 10-10-2005 10:25 AM
ASCII with redhat 6.x knifeman Linux - Newbie 3 08-22-2005 07:14 AM
ASCII help My_World Linux - General 1 04-13-2003 12:17 PM

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

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