Thread: New Project

  1. #16
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    >Probably console app if you're new to programming.

    Windows programming is somthing you can look into a bit down the road. I am fiddled with it, but I need more knowledge on C++ in general first. Like manutd said, use console app, it's perfect for what you need
    Double Helix STL

  2. #17
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I don't see why the OP even needs to use a project. I never needed to use projects until I started writing SDL or multifile programs.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #18
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    I guess dwks, but then again the option is there is he wants to expand on it and add a header file for say a player class later on, but I do see your point
    Double Helix STL

  4. #19
    Registered User
    Join Date
    Nov 2006
    Posts
    22
    ok this is what I got so far. i got in error when i get to please enter ur bet line. can you at least tell me if im on the right track?

    Code:
    #include <iostream>
    #include <cstring>
    
    using namespace std; // So we can see cout and endl
    
    int main()
    {
      
        int bet;
        const double bankBalance = 40.00;
        bet <= bankBalance;
        
        cout<<"Welcome to Kevin's Casino\n";
        char name[50];
        cout<<"Please enter your name: ";
        cin.getline ( name, 50 );
        cout<<"You are starting with 40\n";
        cout<<"Please Enter your bet:";

  5. #20
    Registered User
    Join Date
    Nov 2006
    Posts
    22
    how would I declare theres 50% chance to win bet?

  6. #21
    Registered User
    Join Date
    Nov 2006
    Posts
    22
    damn jus read that u gotta use rand() for this guess i gotta pospone my "project" n do some readin thx for help

  7. #22
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    >cin.getline ( name, 50 );

    should be

    Code:
    getline( cin, name );
    If you plan to use C++, then use C++ strings instead of char arrays.

    Code:
    // declaration
    string name;
    To use rand you need to include these headers

    Code:
    #include <cstdlib>
    #include <ctime> // for srand() and number generator seeding
    Double Helix STL

  8. #23
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    I assume you solved you're problem from three posts ago, but just in case, you're missing a closing bracket in main().
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  9. #24
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    If you plan to use C++, then use C++ strings instead of char arrays.
    For which you need to include <string>.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 09:05 AM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 09:01 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM