mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ASCII VALUE : Bansal Sir

4 posters

Go down

ASCII VALUE : Bansal Sir Empty ASCII VALUE : Bansal Sir

Post  ballu Sun Feb 01, 2009 9:21 pm

U have probabaly seen this
Write a macro to give the ASCII value of a character??
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  mnnit.rahul Tue Feb 03, 2009 12:03 pm

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

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  Beagle Tue Feb 03, 2009 3:54 pm

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.

Beagle

Posts : 40
Join date : 2009-01-30

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  Beagle Tue Feb 03, 2009 4:43 pm

#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

Beagle

Posts : 40
Join date : 2009-01-30

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  mnnit.rahul Tue Feb 03, 2009 6:26 pm

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????

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  mnnit.rahul Tue Feb 03, 2009 6:27 pm

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

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  Beagle Tue Feb 03, 2009 10:41 pm

#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;
}

Beagle

Posts : 40
Join date : 2009-01-30

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  $corpion Tue Feb 03, 2009 10:46 pm

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....
$corpion
$corpion

Posts : 25
Join date : 2009-01-30
Age : 37

Back to top Go down

ASCII VALUE : Bansal Sir Empty Re: ASCII VALUE : Bansal Sir

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum