Like Tree1Likes
  • 1 Post By kmdv

C++ lexigraphical names?

This is a discussion on C++ lexigraphical names? within the C++ Programming forums, part of the General Programming Boards category; Im stuck on how to out the first name enter lexographically. Im suppose to write a string function begin that ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    1

    C++ lexigraphical names?

    Im stuck on how to out the first name enter lexographically. Im suppose to write a string function begin that sends the output to main. Any help would be appreciated.

    [code]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    #include
    <iostream>
    #include <string>

    using namespace std;

    void begin (string nameA, string nameB)
    {
    nameA = nameB =

    if (nameA < nameB || nameA == nameB)
    {
    cout<<name1;
    }
    else if (nameB > nameA)
    {
    cout<<name2;
    }
    else if (nameB==nameA)
    {
    cout<<name3;
    }
    else
    {
    cout<<name4;
    }
    void charfunct(string name1, string name2, string name3, string name4)


    int main()
    {
    string name1, name2, name3, name4;
    cout<<"Please enter name 1: ";
    cin>> name1;
    cout<<"Please enter name 2: ";
    cin>> name2;
    cout<<"Please enter name 3: ";
    cin>> name3;
    cout<<"Please enter name 4: ";
    cin>> name4;

    cout<<before<<endl;

    }
    Code:
     

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,182
    Please remove the table and use only code tags.
    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.
    よく聞くがいい!私は天才だからね! ^_^

  3. #3
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    671
    Very nice table
    MK27 likes this.
    I never put signature, but I decided to make an exception.

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Obviously C++ is taking a holiday this week. Perhaps it is busy preparing presents with Santa.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File names
    By Nzanya in forum C Programming
    Replies: 1
    Last Post: 02-24-2005, 05:38 AM
  2. Help with Names
    By big146 in forum C++ Programming
    Replies: 13
    Last Post: 06-07-2004, 01:26 PM
  3. Old names?
    By Fordy in forum A Brief History of Cprogramming.com
    Replies: 80
    Last Post: 10-28-2001, 06:39 PM
  4. former names...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-17-2001, 05:03 AM

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