Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

printf() and integer type

Altera_Forum
Honored Contributor II
1,102 Views

Hello! 

 

I have a problem with printf() command. 

 

For this: 

 

int a = 5; 

printf (a); 

 

Eclipse send me warning passing argument 1 of 'printf' makes pointer from integer without a cast 

and nothing is printed in console. 

 

What's the reason of this? 

 

Thanks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
339 Views

try: 

 

printf("%d", a); 

 

C language is different from Basic.
0 Kudos
Altera_Forum
Honored Contributor II
339 Views

Oh, it works, thanks a lot!

0 Kudos
Reply