Thread: isalpha case

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    8

    Question isalpha case

    Hello guy..

    i beginner in c++ programming......so here i want to know the simply coding for dis ouput.....


    http://i1.tinypic.com/rrr40o.gif


    easy for u all...not for me....thanks...

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    do your own homework.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Simple enough:
    Code:
    #include <iostream>
    int main() {
    	std::cout << "Enter words (q to quit):\n"
    		"The 12 awesome oxen ambled\n"
    		"quietly across 15 meters of lawn. q\n"
    		"5 words beginning with vowels\n"
    		"4 words beginning with consonants\n"
    		"2 others";
    }
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    8
    come on guys...just gimme a clue....
    i've search an example at internet but still not understand how to use isalpha()......


  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Header File

    ctype.h

    Category

    Classification Routines

    Syntax

    #include <ctype.h>

    int isalpha(int c);

    int __iscsymf(int c);

    int iswalpha(wint_t c);

    #include <mbstring.h>
    int _ismbcalpha(unsigned int c);

    Description

    Classifies an alphabetical character.

    isalpha is a macro that classifies ASCII-coded integer values by table lookup. The macro is affected by the current locale's LC_CTYPE category. For the default C locale, c is a letter (A to Z or a to z).

    You can make this macro available as a function by undefining (#undef) it.

    Return Value

    isalpha returns nonzero if c is a letter.

    __iscsymf returns true if and only if the argument c is a letter or an underscore.

    iswalpha returns nonzero if c is a wchar_t in the character set defined by the implementation.

    _ismbcalpha returns true if and only if the argument c is a single-byte ASCII English letter.
    that's your clue - now get to work.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  6. #6
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    What the guys are trying to say is we won't write your code for you. You must post the code you have and we can help you fix it... But you have to do most of the work.

    And 'dis' is spelled with a th, not a d. We aren't inner-city ghetto types here. At least some of us aren't.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Segmentation fault!?!?!?
    By Viper187 in forum Windows Programming
    Replies: 57
    Last Post: 10-02-2008, 09:40 PM
  2. Format Precision & Scale
    By mattnewtoc in forum C Programming
    Replies: 1
    Last Post: 09-16-2008, 10:34 AM
  3. Base converter libary
    By cdonlan in forum C++ Programming
    Replies: 22
    Last Post: 05-15-2005, 01:11 AM
  4. Creating pop up menus
    By Ti22 in forum C++ Programming
    Replies: 22
    Last Post: 01-18-2005, 09:27 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM