ASCII VALUE : Bansal Sir
4 posters
Page 1 of 1
ASCII VALUE : Bansal Sir
U have probabaly seen this
Write a macro to give the ASCII value of a character??
Write a macro to give the ASCII value of a character??
ballu- Posts : 58
Join date : 2009-02-01
Re: ASCII VALUE : Bansal Sir
- Code:
# include<iostream>
#define CHAR(x) (int)x
using namespace std;
main()
{
char i='1';
cout<<CHAR(i);
}
mnnit.rahul- Posts : 51
Join date : 2009-02-01
Re: ASCII VALUE : Bansal Sir
Etawah tum i mein ascii value hi to store kar rahe ho... aur phir uska typecast kar rahe ho.
Maine jo macro diya tha usme keval character daalo aur uski ascii value answer paaao.
Maine jo macro diya tha usme keval character daalo aur uski ascii value answer paaao.
Beagle- Posts : 40
Join date : 2009-01-30
Re: ASCII VALUE : Bansal Sir
#define CHAR(x) *(#x)
YE PRINT KAR RAHA HAI ASCII VALUES... JISKO IS ANSWER SE DIKKAT HO TO EK HI BAAT BOLUNGA KI CHALA KE DEKH LO APNE COMPU PE
YE PRINT KAR RAHA HAI ASCII VALUES... JISKO IS ANSWER SE DIKKAT HO TO EK HI BAAT BOLUNGA KI CHALA KE DEKH LO APNE COMPU PE
Beagle- Posts : 40
Join date : 2009-01-30
Re: ASCII VALUE : Bansal Sir
are beagle bhai itna gussa mat karo
aur tum mere mein kya bol raahe the
# include<iostream>
#define CHAR(x) (int)x
using namespace std;
main()
{
cout<<CHAR('A');
}
ab sahi hai????
aur tum mere mein kya bol raahe the
# include<iostream>
#define CHAR(x) (int)x
using namespace std;
main()
{
cout<<CHAR('A');
}
ab sahi hai????
mnnit.rahul- Posts : 51
Join date : 2009-02-01
Re: ASCII VALUE : Bansal Sir
beagle bhai mmmmaaaaaaine aapka code chalaya nahi chal raha hai please apna pura code paste karo may be mein galat input le raha hoon
mnnit.rahul- Posts : 51
Join date : 2009-02-01
Re: ASCII VALUE : Bansal Sir
#include <stdio.h>
#define CHAR(x) *(#x)
int main()
{
.......printf("%d", CHAR(A)); // ab yahaan par A ki jagah kuch bhi daalo... a b c A B C 1 2 3 etc.
.......return 0;
}
#define CHAR(x) *(#x)
int main()
{
.......printf("%d", CHAR(A)); // ab yahaan par A ki jagah kuch bhi daalo... a b c A B C 1 2 3 etc.
.......return 0;
}
Beagle- Posts : 40
Join date : 2009-01-30
Re: ASCII VALUE : Bansal Sir
garg's code is just perfect solution i wd say...
etawah wat u r doin is like doin half f the work using ' ' ...these braces...
but garg plzz do explain ur code..wats * doin there....
etawah wat u r doin is like doin half f the work using ' ' ...these braces...
but garg plzz do explain ur code..wats * doin there....
$corpion- Posts : 25
Join date : 2009-01-30
Age : 37
Similar topics
» PRODUCTS: Bansal Sir
» Guess Output - Bansal Sir
» FIND ELEMENTS: Bansal Sir
» from ACM modified first problem:Bansal Sir
» NESTED INDENTATION:Bansal Sir
» Guess Output - Bansal Sir
» FIND ELEMENTS: Bansal Sir
» from ACM modified first problem:Bansal Sir
» NESTED INDENTATION:Bansal Sir
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|