473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to convert a base 8 number into decimal number... help me pls thks

8
pls help to solve this problem : using C programming to convert a base 8 number into a decimal number... thks
Nov 16 '06 #1
4 2656
Banfa
9,065 Expert Mod 8TB
Do you mean a string containing a base 8 number?

C/C++ only operates in 1 base, base 2 (binary), all other bases are just input/output notations because humans find binary a little hard to read.
Nov 16 '06 #2
c2h
8
Hi, Banfa... thanks for your reply. I also not very sure. But the question is : using a appropriate programming language, write a program that convert a whole number input by the user from base 8 to base 10. The program should flag as an error any input that contain 8 or 9.

i very appreciate ur reply. can u suggest for me what else programming language is appropriate to this question.. ? thanks
Nov 16 '06 #3
Banfa
9,065 Expert Mod 8TB
A-ha the real specification always helps.

So you need to convert an ASCII string of digits to a binary value assuming that the string of digits is given in base 8.

The is a function in the standard library that will do this without too much hassle

long strtol ( const char * string, char** endptr, int radix );

Look it up, it is declared in stdlib.h
Nov 16 '06 #4
c2h
8
haha.... thankyou.... actually i not very understand, but i will try to find it out...
thanks you a lot
Nov 16 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ferran | last post by:
Hi, does anybody know how to convert in C++ from base 10 to any other base without loosing the decimal part of the actual value? I came up with this algorithm to convert from decimal to any base...
13
by: Hako | last post by:
I try this command: >>> import string >>> string.atoi('78',16) 120 this is 120 not 4E. Someone can tell me how to convert a decimal number to hex number? Can print A, B, C,DEF. Thank you.
4
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
13
by: muss | last post by:
how to convert decimal number in a hexadecimal number using C? Please help me. Thanks.
2
by: c2h | last post by:
pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
1
by: ahoway | last post by:
I am working on a program where I have to enter a decimal number and enter a base and it converts according to base. output: Please enter a decimal number to convert: 15 <-input What base would...
6
by: sweeet_addiction16 | last post by:
hello Im writin a code in c... can sum1 pls help me out in writing a c code to convert decimalnumber to hexadecimal number.The hexadecimal number generated has to be an unsigned long.
8
by: te509 | last post by:
Hi guys, does anybody know how to convert a long sequence of bits to a bit-string? I want to avoid this: '949456129574336313917039111707606368434510426593532217946399871489' I would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.