Forum Discussion
matif
Occasional Contributor
7 years agoCode output on putty not correct?
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "C:\altera\15.1\embedde...
PHJ
Occasional Contributor
7 years agoUsing %c for the printf formatter prints the ASCII char for the value in led - it looks like this is expected to be 1-15 which are not in the alpha-numeric ASCII range.
Are you sure you want "%c" here ? Suggest that you use "%d" instead.
- matif7 years ago
Occasional Contributor
Hi, thanks for your answer. I also tried %d but everytime I run my program, the output is always 173. no matter whether I give input 10 , 11 or 12 , the output is always 173. Any ideas what is happening.?