Results 1 to 6 of 6

Thread: Convertion from VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    Convertion from VB

    J'm just beginner to C++ and I'd like to translate this vb loop to C++ ; if anyone can help me with this:

    For Pmi = 1 To L: lett(Pmi) = Mid(word, Pmi, 1): Next Pmi

  2. #2
    jim mcnamara
    Guest
    PHP Code:
    char word[100];
    int pmi;
    char dest[100]
    // strcpy(word,"some stuf or another");
    for(pmi=0;pmi<strlen(word);pmi++)
    {
          
    dest[pmi] = word[pmi];
    }
    // this algorithm makes very little sense in c, or VB either. 

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4
    Thanks for your support, but of course it was abstracted from context, so here is the rest of the code (see attachment below). This is quite efficient permutation procedure (even in VB - works quite fast), so I'm trying to rewrite it to C++. I've recoded a little of this stuf, but the errors I've received are too difficult for me to ovecome at this stage of my C++ knowledge (As I said J'm new to C). So I'd be very grateful for help with translating this procedure (even partly- suggestions and comments).
    Attached Files Attached Files

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    i think the line you posted here should copy a string into an array of characters. this makes no sense in c because strings in c are already array of characters.

    so, in your code, what does
    Select Case OChoice
    mean? There is no variable named OChoice (i'm rather a c programmer than vb), the vb-reference has no such entry and the description of the select case block doesn't describe it either.
    Could you help me out, so I could help you?

    All the buzzt
    CornedBee

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    more questions:
    what is result in this case?
    what is BFInitialise?
    what does processcode do?

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    Re:Convertion from VB

    Here is the rest of code (see attachment).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width