Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to use 'long long int' or 'unsigned long int' in C prog

Status
Not open for further replies.

rizalafande

Junior Member level 2
Joined
Jan 4, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,435
long int in c

hi,
i got the problems to use the 'long long int' and 'unsigned long int' data types in C programming (becasue i would like to use 64bit and unsigned 32bit data in my design). when i run the simulation using Linux compiler (gcc), it is always give me an error "warning: this decimal constant is unsigned only in ISO C90". example of my codes are written below.
===================
long long int newValue (long long int a)
{
unsigned long int res;

a = 2147483700;
res = a*1;

}
====================
can anyone helps me out. thanks.
 

jhbbunch

Full Member level 4
Joined
Feb 21, 2006
Messages
199
Helped
17
Reputation
34
Reaction score
3
Trophy points
1,298
Activity points
2,902
long long int in c

First, you have a return of long long int, buy there is no return of anything in the fucntion. Second whis is res an unsigned long int and a is a long long int? The compiler is warning you that this is valid only in the iso c90 standard. I assume other standards will treat one as signed and the other as unsigned.

And it appears that unsigned long int is a 32 bit value (check this) and long long int is definitely a 64 bit integer. Just change res to long long int.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top