Thread: First letter is missing

  1. #16
    Tears of the stars thames's Avatar
    Join Date
    Oct 2012
    Rio, Brazil
    I think it's okay now.

    #include <iostream> 
    #include <string>
    #include <cstring>
    #include "../Headers/golf.h"
    int main() 
       using std::cout; 
       using std::cin; 
       using std::strlen;
       using std::string; 
       using sport::showgolf;
       using sport::setgolf;
       using sport::golf; 
       string fullname;
       int players, handicap; 
       cout << "How many players are playing? "; 
       while(!(cin >> players))
         while(cin.get() != '\n') 
         cout << "Please enter how many players are playing: ";     
       golf *golfers = new golf[players];
       for(int i = 0; i < players; i++) 
          cout << "Enter your full name: "; 
          cin >> fullname;
          cin.ignore(sizeof(fullname), '\n');
          cout << "Enter the handicap: "; 
          (cin >> handicap).get();
          setgolf(golfers[i], fullname, handicap);
       for(int i = 0; i < players; i++) 
       delete [] golfers; 

  2. #17
    Join Date
    Oct 2007
    Inside my computer
    Use std::vector as laserlight has shown you.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 11-24-2012, 04:10 AM
  2. How To Make Capital Letter To Small Capital Letter??
    By jason07 in forum C++ Programming
    Replies: 3
    Last Post: 10-10-2005, 04:37 PM
  3. Big Letter became small letter
    By cogeek in forum C Programming
    Replies: 27
    Last Post: 12-13-2004, 02:04 PM
  4. I got a letter from the IRS.
    By Cheeze-It in forum A Brief History of
    Replies: 10
    Last Post: 09-26-2002, 03:53 PM
  5. Letter
    By drdroid in forum C++ Programming
    Replies: 1
    Last Post: 02-27-2002, 09:12 PM

Tags for this Thread