Results 1 to 4 of 4

Thread: convert c++ to vb6

  1. #1

    Thread Starter
    Registered User
    Join Date
    Oct 2014
    Posts
    1

    Unhappy convert c++ to vb6

    Can anyone help me convert a c++ program to vb6? im having trouble converting it im getting error in the while loop

    Code:
      
    /****    Program to Insert an Element into an Unsorted Array    ****/  
    #include <stdio.h>  
    void insert_unsorted();
    int a[50], n, loc, item;  
    main() { 
        int i;    
        printf("\nEnter size of an array: ");  
        scanf("%d", &n);    
        printf("\nEnter elements of an array:\n");  
        for(i=0; i<n; i++)   
        scanf("%d", &a[i]);     
        
        printf("\nEnter location of insertion: ");  
        scanf("%d", &loc);    
        
        printf("\nEnter ITEM to insert: ");  
        scanf("%d", &item);    
        
        insert_unsorted();    
        
        printf("\n\nAfter insertion:\n");  
        for(i=0; i<n; i++)   
        printf("\n%d", a[i]);  
        
        getch(); 
        
    }  
    void insert_unsorted() {  
        int i=n-1;    
        while(i>=loc-1)  
        {   
            a[i+1] = a[i];   
            i--;  
            
        }  
        a[loc-1] = item;
        n++; }

    please i really need help

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: convert c++ to vb6

    post what you have done and we can take a look see
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,440

    Re: convert c++ to vb6

    im having trouble converting it im getting error in the while loop
    *sigh*
    And what error are you getting? My Divination-skills are a little bit rusty.....
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: convert c++ to vb6

    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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