Can u help me to do this pls

Decoding steps.

1. Discard the "0E" from the beginning of the string and if there is a 0(zero)at the end of the string discard that as well.
2. Reverse the digits of the string.
3. Convert the hexadecimal to 4 bit binary values starting from the right.
4. Concatenate the binary values and discard the 0's(zeros) which are at the beginning of binary string
5. Convert the binary values (7 bits) to hexadecimal values, according to the GSM 7-bit default alphabet(Hexadecimal).
6. Reverse the output of the above conversion.


Example (1). originatingAddress 0E146795E470'TBCD


Step1). 0E 146795E47 0'TBCD

Step2). 146795E47 ----Reverse the digits----> 74E597641

Step3). 01110100 11100101 10010111 01100100 0001

Step4). 011101001110010110010111011001000001 ---> 11101001110010110010111011001000001


Step5). 1110100 1110010 1100101 1101100 1000001
74 72 65 6C 41
t r e l A

Step6). Alert
How can u ask like that, without even trying to code.Please try to write ur own program, if there are any problems raise them, surely i will help.
ok , I have tried upto step 1. can you tell me how to reverse the string pls.
I' trying to do with a loop. is there any otherway ???
Are u using string or char*?
in case of char*:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    void reverse()
    {
         char* mystr="abcde";
         char* temp1;
         char* reverse;
         int length=0,length1=0;
         temp1=mystr;
         //fetch the string length
        while(*temp1 != NULL)
        {
         length++;
         temp1++;
        }

        //assign memory to reverse based on actual string lenth
        reverse=new char[length];

        //store charaters in reverse
        while(length>0)
        {
        reverse[length1]=*--temp1;
        length1++;
        length--;
        }

        //store NULL at the last character
        reverse[length1]='\0';
        cout<<reverse;
        
    }
Last edited on
Topic archived. No new replies allowed.