Search:

Type: Posts; User: PersianStyle

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    948

    OK sorry, I knew that, I my brain just wasn't...

    OK sorry, I knew that, I my brain just wasn't working at that time.
    I will try to figure out my problems on my own before jumping to posting for now on, sorry guys
  2. Replies
    3
    Views
    948

    Question about Arrays

    How come when I run this code:


    #include <iostream>
    using namespace std;

    int main()
    {
    int examplearray[95];
    examplearray[95] = 50;
  3. Yes, OK i figured it out on my own, I have to set...

    Yes, OK i figured it out on my own, I have to set the values of the array. So I fixed my code.


    #include <iostream>
    using namespace std;

    int main()
    {
    int examplearray[100];
    int t;
  4. New to C++ Stuck on Arrays. Help please!

    I am learning C++ and I am currently learning Arrays.
    However, I am stuck :(
    I type the following code:


    #include <iostream>
    using namespace std;

    int main()
    {
  5. No thanks, I hate reading books LoL I been...

    No thanks, I hate reading books LoL
    I been learning a lot better this way.
  6. well I tried to put return; just to see and it...

    well I tried to put return; just to see and it compiled
    But I just dont put a return statement at all and remove the line completely.
    Is this correct?
  7. When you say that is not standard C++ do you mean...

    When you say that is not standard C++ do you mean the code won't work or you just mean it is not good form or w\e
  8. why do you say to have return; instead of return...

    why do you say to have return; instead of return 0;
    I tried it without putting return; at all and just completely removing that line and it worked fine?

    Yes I know I should start out with having...
  9. Replies
    17
    Views
    1,948

    There are two ways I know you can do this: 1)...

    There are two ways I know you can do this:
    1) After cin >> gallons; put cin.ignore();
    Then put cin.get(); before return 0;
    Example:


    #include <iostream>
    using namespace std;

    int...
  10. And to define and declare a function about the...

    And to define and declare a function about the int main() I can just put it like this without the semicolon:


    void NewGame()
    {
    // type code here
    }

    Or would I have to do it like this:
  11. Oh OK, so basically instead of having this at the...

    Oh OK, so basically instead of having this at the end of my defined function:


    return 0;

    I can just remove that and change the function from int NewGame() to void NewGame()
    correct?
    Also, in...
  12. Well here is my new updated progarm: ...

    Well here is my new updated progarm:


    #include <iostream>
    using namespace std;

    int newgame();
    int restoregame();

    int main()
  13. So here is my new updated code and it does what I...

    So here is my new updated code and it does what I want it to do pretty much:


    #include <iostream>
    using namespace std;

    int main()
    {
    int Selection = 0;
    cout << "Welcome to BlackJack!...
  14. OK Thank you, what my problem was that I didnt...

    OK Thank you, what my problem was that I didnt understand is that when I put the semi colon after the while loop it would make it an infinite loop
  15. hmm... I understand that except for the last part...

    hmm... I understand that except for the last part where it says:


    } while (HottestGirl == 0);

    What is this there for?
    Also, one thing this doesn't do is display "Selection: " before the...
  16. Need help with simple code. Very new to C++

    OK, I am very new to C++ so if anything is incorrect or there is an easier way or whatever, please let me know.
    Here is some code I wrote just to mess around and try to start a program. I was trying...
  17. I don't understand. I have: ...

    I don't understand.
    I have:


    while(HottestGirl==1||2||3||4)

    And it does what I want it to do, which is keep asking for the selection no matter what the user enters.
  18. ooooooOOOOOOOOOOOOOOOooooOOOooo ahhaha I feel so...

    ooooooOOOOOOOOOOOOOOOooooOOOooo ahhaha I feel so stupid for forgetting that
    Thanks!
  19. So when I put: while(HottestGirl=1) It is...

    So when I put:


    while(HottestGirl=1)

    It is assigning 1 to the variable HottestGirl?

    How would I make then so it is like if the variable HottestGirl equals 1, then go through the loop?
  20. Simple program I made - Question about code

    Hello
    I was messing around with Microsoft Visual C++ 2008 Express.
    I am new to programming and am trying to learn C++
    So here is a simple program I made:



    #include <iostream>

    using...
Results 1 to 20 of 20