- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I want to invoke abs() function in NiosII.
But i find this function does not defined. Which header file should I include? or I should implement it by myslef?링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
It should be there, as a part of newlib. Try including stdlib.h and see if that works.
Here's a brief description from a website I found:Synopsis
# include <stdlib.h>
int abs(int i);
Description
abs returns the absolute value of i (also called the magnitude of i). That is, if i is negative, the result is the opposite of i, but if i is nonnegative the result is i.
The similar function labs uses and returns long rather than int values.
Returns
The result is a nonnegative integer.
Portability
abs is ANSI.
No supporting OS subroutines are required.
- slacker
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
That's OK.
abs() is working now when i add <stdlib.h> . THX!