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,155 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
392 Views

try: 

 

printf("%d", a); 

 

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

Oh, it works, thanks a lot!

0 Kudos
Reply