how to add numbering with Alpha

example: x = PH
y = 4

how to return a
z = PH4

can I use positioning?
but what is the return value's data structure?

please help, Thank you very much

Comments

  • : example: x = PH
    : y = 4
    :
    : how to return a
    : z = PH4
    :
    : can I use positioning?
    : but what is the return value's data structure?
    :
    : please help, Thank you very much
    :
    :

    I may not understand your problem all too well, but are you wanting to do something like: z = x + y? If that is the case then you can use the string data type to perform concatenation. Define both x and y to be strings (string.h) and the header file includes operator overloading. The syntax would be:

    [code]
    #include
    using namespace std;

    void main()
    {
    string x = 4;
    string y = PH;
    string z = y + x;
    }
    [/code]

    Or, you can use c-style character types by using the function strcat() as follows:

    [code]
    void main()
    {
    char x[2] = "4";
    char y[3] = "PH";
    char z[2] = "";

    z = strcat(x, y);
    }
    [/code]

    I forget if strcat returns the value or merely stores it into the first parameter. This will need to be checked. Both of these methods concatenate two strings together into one. Is that what you were needing?


    --------------------------------------------
    Jordan - "MeshArtist"
    "Ever saint has a past and every sinner has a future."
    --------------------------------------------

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion