Thread: kinda new need help

  1. #1
    Registered User
    Join Date
    Mar 2011

    kinda new need help

    Hey there im taking a intro course to c++ and we have a small assignment where we have the user input a string like:
    He was 14 ten years ago. The next line should display just the numbers.
    int main()
    	char word[20];
    	int a;
    	cout<<"Enter a sentence with at least one number in it."<<endl;
    	if(!isdigit((unsigned char)word[20])>=0)
    i also know i have all the appropriate includes just need to know how to get the isdigit to check the string and pull the numbers for display.
    thanks ahead of time.

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    What? You are not making any sense as to what you want to do.
    Also, it is a good idea to replace char word[20] with std::string word and cin.getline(...) with std::getline(std::cin, word).
    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. Math Parser's kinda cool
    By jverkoey in forum A Brief History of
    Replies: 20
    Last Post: 06-17-2005, 01:53 PM
  2. Dos Graphic....kinda
    By Xeavor in forum C++ Programming
    Replies: 7
    Last Post: 10-14-2004, 01:14 AM
  3. Kinda surprised no one has mentioned this ("Under God" Decision")
    By Thantos in forum A Brief History of
    Replies: 84
    Last Post: 06-21-2004, 08:45 PM
  4. Math question... kinda abstract
    By ygfperson in forum A Brief History of
    Replies: 7
    Last Post: 05-12-2003, 05:46 PM
  5. Video Game Violence - a new twist...kinda
    By Cshot in forum A Brief History of
    Replies: 19
    Last Post: 11-26-2002, 11:04 AM