the character 'N' has the value of 78
so would i define it as:
#define N '78'
so i can use it in this example:
if (arr[i][j] == N ) {
statement;
}
thanks
the character 'N' has the value of 78
so would i define it as:
#define N '78'
so i can use it in this example:
if (arr[i][j] == N ) {
statement;
}
thanks
no
'78' is not a character
if you want to declare a character with ascii value of 78
just use 78
eg.,
char c=78;
thanks alot.. this is the help i was looking for.. now my program working and is successfully on its way.. thanks
But since you can say
if ( arr[i][j] == 'N' ) {
You don't need to define anything, and you don't need to know the ascii value for N, and you don't even care if your character set isn't ascii.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
You are right , I was wrong , ascii has nothing to do with it , I meant the numerical value of the character .