Like Tree5Likes

First letter is missing

This is a discussion on First letter is missing within the C++ Programming forums, part of the General Programming Boards category; I think it's okay now. Code: #include <iostream> #include <string> #include <cstring> #include "../Headers/golf.h" int main() { using std::cout; using ...

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

    Code:
     
    #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))
       { 
         cin.clear();
         while(cin.get() != '\n') 
           continue; 
         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++) 
       { 
         showgolf(golfers[i]);  
       }       
       delete [] golfers; 
    }

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,020
    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.

Page 2 of 2 FirstFirst 12
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, 05: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 Cprogramming.com
    Replies: 10
    Last Post: 09-26-2002, 04:53 PM
  5. Letter
    By drdroid in forum C++ Programming
    Replies: 1
    Last Post: 02-27-2002, 09:12 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21