Thread: VB to C++ problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    7

    VB to C++ problem

    Hello, im trying to port some vb code into C++, and ive run into a snag.

    I took the following code in vb:

    Code:
    For Index = 0 To 71
    	T1 = (T1 + TempCard(TempCard(Index) Mod 17) + TempCard(Index)) And &HFF&
    	TempCard(Index) = T1
    Next Index
    And Rewrote it in C++ to get:

    Code:
    for (unsigned int n = 0; n < 72; n++){
    	T1 = (T1 + TempCard[TempCard[n] % 17] + TempCard[n]) & 0xFF;
    	TempCard[n] = T1;
    }
    I cant find anything wrong with the C++ code, however its returning different values in TempCard and T1 then the vb app. They are the same values going into the loop, but different coming out. Also, TempCard[72] is an integer and T1 is also an integer. Any help would be appreciated.

    Mike

    Edit: typo
    Last edited by Mike_01; 04-04-2004 at 02:46 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  3. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. Sending a string to C++ from VB 6.
    By VirtualAce in forum C++ Programming
    Replies: 4
    Last Post: 08-21-2001, 02:28 AM