我怎样才能让我的ADS项目的atoi工作? [英] How can I make atoi work in my ADS project?

查看:267
本文介绍了我怎样才能让我的ADS项目的atoi工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用的atoi 功能在我的计划,但我发现它不工作。

I want to use atoi function in my program, but I found it not working.

#include <ctype.h>
int value;
value=atoi(buf);

字符BUF 指向1000之类的东西,由终止\\ 0 。我已经检查了。
但价值总是计算结果为零。我曾尝试与strtol(),但我得到了同样的错误。

char buf points to "1000" or something like, terminated by \0. I have checked it. But the value evaluates always to zero. I have tried strtol(), but I get the same error.


  1. 我的ADS(ARM开发套装)是V1.2(S3C2440)。我可以找到ARMLIB路径库(c_t_xx.l)。

  2. 我用 AXD 调试模式,这样我就可以跟踪我的code。我发现BL结果
    __rt_ctype_table
    ,所以我认为ASM code链接的权利。

  1. My ADS (ARM Developer Suit) is v1.2 (s3c2440). I can find the libs in armlib path (c_t_xx.l).
  2. I use axd debug mode, so I can trace my code. I found "bl
    __rt_ctype_table"
    , so I think asm code linked right.

请提供任何意见来解决这个问题。

Please give any advice to fix this issue.

推荐答案

ARM可能与字符串函数的一个问题,你有没有提到是否会返回一个值,这是不正确的(我听说这是一个错误,它的更好,你应该写你自己的功能),或存在完全没有价值。
反正看一下手臂文章中,我认为这是解决方案 - 的 ARM有关字符串函数文章

ARM might have a problem with string functions, you haven't mentioned whether it returns a value and it's incorrect (i heard it's a bug and it's better you should write the function on your own) or there is no value at all. anyway look at the arm article about it i think it's the solution - ARM article about string functions

这篇关于我怎样才能让我的ADS项目的atoi工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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