printf and simple types

Post Reply
bitvision
New member
Posts: 2
Joined: Thu Nov 07, 2013 9:37 pm

printf and simple types

Post by bitvision »

Hi!
I am trying something so simple like

testtype.c:

#include<stdio.h>
#include<stdlib.h>

main(){

int i = 0;
long j = 0;

printf("i = %d\n");
printf("j = %ld\n");

}

compiling that
zcc +msx -create-app testtype.c

and testing that on openMSX
bload"a.msx",r
the result is
i=-25381
j=-1662657721

Does anyone know how can I show right values with printf ?

Thanks in advance :-D
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

printf("i = %d\n", i);
printf("j = %ld\n", j);


:)
bitvision
New member
Posts: 2
Joined: Thu Nov 07, 2013 9:37 pm

Post by bitvision »

Lol! So sorry :-D
Post Reply