quick question function prototypes new to this

This is a discussion on quick question function prototypes new to this within the C++ Programming forums, part of the General Programming Boards category; If the function prototype Code: isalpha(charExp) evaluates to a letter, what is the funtion prototype that evaluates to a whole ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    6

    quick question function prototypes new to this

    If the function prototype
    Code:
     isalpha(charExp)
    evaluates to a letter,

    what is the funtion prototype that evaluates to a whole sentence?

    I have tried:
    Code:
    isgraph
    isspace
    but they only count the letters and the space, is there one that counts words, or sentences?

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    You want a function that returns if it's a sentence or not? There is no such standard function to do such a thing. It really depends on how you're defining a sentence. Should the function check to see if it has a subject and an object? Should it just check to see if it ends in a period? Should it check to see if it isn't a run-on? Depending on it's exactness it can be anywhere from extremely easy to slightly complex (and I use complex loosely here) to make. There is no standard function, though.
    Sent from my iPadŽ

  3. #3
    Registered User SKeane's Avatar
    Join Date
    Sep 2006
    Location
    England
    Posts
    234
    Maybe you want to see if a string (i.e. char array) consists of only (say) alpha characters? In which case you'd need to run a for loop for the length of the string and call isalpha() (and isspace()) on each character in the string. It's up to you whether you bail out at the first non-alpha, or check the whole string (depends on what information you want).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 12:49 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  3. Question about function prototypes
    By Mikecore in forum C Programming
    Replies: 2
    Last Post: 11-20-2005, 04:39 PM
  4. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 08:10 AM
  5. Another quick question
    By Unregistered in forum C++ Programming
    Replies: 0
    Last Post: 12-03-2001, 02:30 PM

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