Hello.... for VB is Chr() and Asc()
and for C?? Is a little and stupid question.. i know. but i can't find those functions...
Thanks
and for C?? Is a little and stupid question.. i know. but i can't find those functions...
Thanks
| Code: |
|
char x = 61; // ascii for "=" cout<<"x is: "<<x<<endl; cout<<"x is: "<<(int)x<<endl; |
| Code: |
|
= 61 |
| asDdsA2 wrote: |
| Hello.... for VB is Chr() and Asc()
and for C?? Is a little and stupid question.. i know. but i can't find those functions... Thanks |
| Code: |
| /* assume ASCII, will not work otherwise */
char * p = name; /* 'name' is the user input */ while (*p) { if ((*p >= 97) && (*p <= 122)) { *p -= 32; } ++p; } printf("uppercased is '%s'\n", name) |
| Code: |
|
int i = 65; cout<<char(i); // It'll print character representing Ascii value of 65 i.e 'A' char a = 'A'; cout<<int(a); // It'll print ASCII value repreented by A, i.e 65 for(i = 65; i <= 90; ++i) cout<<char(i); |