Changing Variable type in C++

Discussion in 'Web Design & Coding' started by undeadpenguin, Nov 3, 2003.

  1. undeadpenguin

    undeadpenguin Bang. VIP Member

    Joined:
    Sep 1, 2003
    Messages:
    925
    Likes Received:
    4
    Location:
    US, CT
    Is there a way to convert a variable from a char array to an integer array without a long if/else of switch statement in C++? I'm trying to make a cryptology program based on an algorithm I found in a book (Cryptonomicon, great read).
     
    undeadpenguin, Nov 3, 2003
    #1
    1. Advertisements

  2. undeadpenguin

    Core in pounce mode Moderator

    Joined:
    Jun 30, 2003
    Messages:
    1,557
    Likes Received:
    24
    Location:
    Akaa, Finland
    Hmmm......this sure takes me back...

    I am really out of touch when it comes to ANY kind of programming, not to mention Cpp..

    I dunno, takin this outta my ****, but would something like the following work..

    //IVAL being integer, CVAL being char

    IVAL = (int)CVAL;

    ..I dunno. Someone else might be able to help..
     
    Last edited: Nov 4, 2003
    Core, Nov 4, 2003
    #2
    1. Advertisements

  3. undeadpenguin

    undeadpenguin Bang. VIP Member

    Joined:
    Sep 1, 2003
    Messages:
    925
    Likes Received:
    4
    Location:
    US, CT
    I'll try that later. Thanks for the help. On other boards I posted people didn't even respond.
     
    undeadpenguin, Nov 4, 2003
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.