将char数组覆盖到整数所需的帮助 [英] help needed on coversin of an char array to an integer

查看:95
本文介绍了将char数组覆盖到整数所需的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有点卡在一个项目中我需要一个数组来将

转换为

整数使用某种数学。

这个主板不支持scanf,sscanf等功能,因为它没有足够的内存来保存它们的堆栈。


给出一个字符串char str [8] = {''0'',''0'',''0'',''1'',''f'',''b' ',

''c'',''a''};

i需要一个可以将此数组转换为整数的函数

(0x0001fbca)


期待快速回复。


谢谢

MAx

Hi,
Im kinda stuck in a project at a point where i need an array to
be converted to a
integer using some kind of math.
This board does not support functions like scanf, sscanf etc as
it does not have enough memory to hold their stack.

given a string char str[8] = {''0'', ''0'', ''0'' , ''1'' , ''f'' , ''b'' ,
''c'' , ''a'' };
i need a function which can convert this array to an integer
( 0x0001fbca )

Expecting a quick response.

Thanks
MAx

推荐答案

2月21日,2:21 * pm,MAx< mahesh1 ... @ gmail.comwrote:
On Feb 21, 2:21*pm, MAx <mahesh1...@gmail.comwrote:
$ b $

* * *我有点卡在一个项目中,我需要一个数组来将

转换为

整数使用某种数学。

* * *这个板不支持scanf,sscanf等功能,因为它没有足够的内存来保存它们的堆栈。


* * *给出一个字符串* char str [8] = {''0'','0'',''0'',''1',''f'',''b'',

''c'',''a''};

* * *我需要一个可以将这个数组转换为整数的函数

(0x0001fbca)


*期待快速回复。


谢谢

MAx
Hi,
* * * Im kinda stuck in a project at a point where i need an array to
be converted to a
integer using some kind of math.
* * * This board does not support functions like scanf, sscanf etc as
it does not have enough memory to hold their stack.

* * * given a string *char str[8] = {''0'', ''0'', ''0'' , ''1'' , ''f'' ,''b'' ,
''c'' , ''a'' };
* * * i need a function which can convert this array to an integer
( 0x0001fbca )

*Expecting a quick response.

Thanks
MAx



我忘了提到数组的内容将在

范围内0到9和a到f,

它是一个十六进制数字读取的数字一次:-)

I forgot to mention that the contents of the array will be in the
range 0 to 9 and a to f,
its a hex number read inone digit at a time :-)


2月21日,09:21,MAx< mahesh1 ... @ gmail.comwrote:
On 21 Feb, 09:21, MAx <mahesh1...@gmail.comwrote:



* * *我有点卡在一个项目中我需要一个数组来将

转换为

整数使用某种数学。

* * *此板不支持scanf,sscanf等功能,因为它没有足够的内存来存放堆栈。


* * *给出一个字符串* char str [8] = {''0'',''0'',''0'',''1',''f'',''b'',

''c'',''a''};

* * *我需要一个可以将这个数组转换为整数的函数

(0x0001fbca)


*期待快速回复。
Hi,
* * * Im kinda stuck in a project at a point where i need an array to
be converted to a
integer using some kind of math.
* * * This board does not support functions like scanf, sscanf etc as
it does not have enough memory to hold their stack.

* * * given a string *char str[8] = {''0'', ''0'', ''0'' , ''1'' , ''f'' ,''b'' ,
''c'' , ''a'' };
* * * i need a function which can convert this array to an integer
( 0x0001fbca )

*Expecting a quick response.



真的吗?

really?


2月21日上午11:21,MAx< mahesh1 ... @ gmail.comwrote:
On Feb 21, 11:21 am, MAx <mahesh1...@gmail.comwrote:



我有点陷入一个项目,我需要一个阵列才能获得$>
使用某种数学转换为

整数。

此板不支持scanf,sscanf等函数,因为

它没有足够的内存来保存堆栈。
Hi,
Im kinda stuck in a project at a point where i need an array to
be converted to a
integer using some kind of math.
This board does not support functions like scanf, sscanf etc as
it does not have enough memory to hold their stack.



哪个董事会就是它?

Which "board" is that?


给定一个字符串char str [8] = {''0'',''0'',''0'',''1'', ''f'',''b'',

''c'',''a''};
given a string char str[8] = {''0'', ''0'', ''0'' , ''1'' , ''f'' , ''b'' ,
''c'' , ''a'' };



这不是一个字符串,因为它没有以0.
终止

That is not a string as it is not terminated with a 0.


i需要一个函数可以将此数组转换为整数

(0x0001fbca)
i need a function which can convert this array to an integer
( 0x0001fbca )



Trivial

Trivial


期待快速反应。
Expecting a quick response.



您是否希望得到答案或您的老师?

Is it you who expects an answer, or your teacher?


这篇关于将char数组覆盖到整数所需的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆