Results 1 to 13 of 13
  1. #1
    awsomeownage's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    33
    Reputation
    12
    Thanks
    0
    My Mood
    Inspired

    [Help] Code Issue

    alright so i put this code into microsoft vb 2010 and im not sure if this is a user error or microsoft being stupid:
    #include <stdio.h>
    #include <iostream>

    using namespace std;

    int main()
    {
    int i;
    for (i=0, i<10; i+1; );
    {
    cout << "Hello World!";
    }
    system ("pause");
    }
    when i run it it does nothing but sit there and blink when i run it. Help please?

  2. #2
    ғᴜᴋᴏᴊʀ's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    1,557
    Reputation
    87
    Thanks
    141
    My Mood
    Inspired
    Try coding in MSVC++ Not in the vB compiler.

  3. The Following User Says Thank You to ғᴜᴋᴏᴊʀ For This Useful Post:

    NextGen1 (01-04-2011)

  4. #3
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Thats some pretty pro vb code you got there

  5. The Following User Says Thank You to whit For This Useful Post:

    why06 (01-02-2011)

  6. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by awsomeownage View Post
    aim not sure if this is a user error or microsoft being stupid:
    Yeh its prbly Microsoft being stupid again... those idiots gave u the wrong compiler.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  7. The Following User Says Thank You to why06 For This Useful Post:

    NextGen1 (01-04-2011)

  8. #5
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    That code won't even work.. even on MSVC++

    I just looked over the code and i see like 3 errors already. lmao :\
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  9. #6
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    9,119
    Reputation
    1096
    Thanks
    1,970
    My Mood
    Doh
    Code:
    for (i=0, i<10; i+1; );
    first of all delete that ";"
    main thread does not return anything,
    Code:
    #include <stdio.h>
    Well, someone please correct me if I'm wrong, but why include this? I mean including "iostream" is sufficient.
    And try to delete that loop.....ah and Visual Basic isn't C++, normally your code shouldn't be compiled idk how can you compile it :/

    So the code should be:
    Code:
    #include <iostream>
    
    int main(void)
    {
          std::cout << "Hello World!" << endl; //or "/n" after "Hello World!"
          system("PAUSE");
          return 0;
    }
    Last edited by ♪~ ᕕ(ᐛ)ᕗ; 01-03-2011 at 04:46 AM.

  10. #7
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by AcE.bu50t View Post
    Code:
    for (i=0, i<10; i+1; );
    first of all delete that ";"
    main thread does not return anything,
    Code:
    #include <stdio.h>
    Well, someone please correct me if I'm wrong, but why include this? I mean including "iostream" is sufficient.
    And try to delete that loop.....ah and Visual Basic isn't C++, normally your code shouldn't be compiled idk how can you compile it :/

    So the code should be:
    Code:
    #include <iostream>
    
    int main(void)
    {
          std::cout << "Hello World!" << endl; //or "/n" after "Hello World!"
          system("PAUSE");
          return 0;
    }

    With:
    Stdio.h

    Code:
    #include <stdio.h>
    
    int main(void)
    {
          printf("Hello World.\n");
          system("PAUSE");
          return 0;
    }
    Problems on that For are more then 1:

    Code:
    for (i=0, i<10; i+1; );
    This would be correct:

    Code:
    for(i = 0; i < 10; i++)
    Last edited by 'Bruno; 01-03-2011 at 05:41 AM.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  11. #8
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by AcE.bu50t View Post
    And try to delete that loop.....ah and Visual Basic isn't C++, normally your code shouldn't be compiled idk how can you compile it :/
    Why delete the loop its obviously for learn purposes..
    but i dont get the point printing it to the screen 10 times

  12. #9
    awsomeownage's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    33
    Reputation
    12
    Thanks
    0
    My Mood
    Inspired
    lol thanks to everyone. And i realize my typo lol. I meant C++ not VB, lol. anyone know a good book to help me learn C++?

  13. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    I recommend
    Code:
    The differences between Visual Basic and C++, By Thomas Medes

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. The Following 2 Users Say Thank You to Jason For This Useful Post:

    ғᴜᴋᴏᴊʀ (01-06-2011),♪~ ᕕ(ᐛ)ᕗ (01-11-2011)

  15. #11
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by awsomeownage View Post
    lol thanks to everyone. And i realize my typo lol. I meant C++ not VB, lol. anyone know a good book to help me learn C++?
    Try out tuts section, loaded with tutorials and guides, also cave the C++ section, you will be surprised with what that section can accidentally teach you.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  16. #12
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by awsomeownage View Post
    anyone know a good book to help me learn C++?
    Any book... besides C++ for Dummies.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  17. #13
    ғᴜᴋᴏᴊʀ's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    1,557
    Reputation
    87
    Thanks
    141
    My Mood
    Inspired
    Quote Originally Posted by Brinuz View Post
    That code won't even work.. even on MSVC++

    I just looked over the code and i see like 3 errors already. lmao :\
    Quote Originally Posted by Jason View Post
    I recommend
    Code:
    The differences between Visual Basic and C++, By Thomas Medes
    Quote Originally Posted by why06 View Post


    Any book... besides C++ for Dummies.
    You three made my day

    Cookie?



    [IMG]https://i186.photobucke*****m/albums/x253/Rypleys/MNC/biohazard2.jpg[/IMG]

    MPGH in 5 words:

    Quote Originally Posted by ZEROProJect View Post
    1 in a million community