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
    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
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 11-24-2012, 03: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, 01: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, 08: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