how do I store a character in a "const char"?

I use the following to store characters in char variables:

1
2
3
4
5
const char COMMENT = '#';
const char DELIM = ','; // delimieter
const char NEWLINE = '/n'; // new line character
const char SPACE = ' '; // space
const char TAB = '/t'; // tab 


but I get the following warnings:

warning C4305: 'initializing' : truncation from 'int' to 'const char'
warning C4309: 'initializing' : truncation of constant value
warning C4305: 'initializing' : truncation from 'int' to 'const char'
warning C4309: 'initializing' : truncation of constant value


how can I write a character literal then??
Last edited on
You meant '\n' and '\t'
not '/n' and '/t'
doh! Thanks
Topic archived. No new replies allowed.