Program to find a greatest string: c - program , C/C++ Programming

Assignment Help:

Program to find a Greatest String: C - Program:

Write a program find largest string by c program.

int main( int argc, char *argv[] )

{

    if( argc < 2 )

        {

        cerr << "Usage:  strngmax string1 [string2 ...]\n";

        return 1;

        }

 

    String theGreatestString( argv[1] );

    int positionOfTheGreatestString = 1;

    int nextArg = 2;

 

    while( nextArg < argc )

        {

        String argListString ( argv[nextArg++] );

        if ( argListString > theGreatestString )

            {

            theGreatestString = argListString;

            positionOfTheGreatestString = nextArg - 1;

            }

        }

 

    cout << theGreatestString << endl;

    return positionOfTheGreatestString;

}

 


Related Discussions:- Program to find a greatest string: c - program

Star, Write a program that finds the minimum total number of shelves, inclu...

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

Advanced, how to create a shopping cart

how to create a shopping cart

Assignment help, #questionHi, I am looking for help with the assignment, ca...

#questionHi, I am looking for help with the assignment, can you help..

Reverse digit function, how can i write reverse digit function like writing...

how can i write reverse digit function like writing 1234 and printing 4321

Z transformer, how to write code for z transformer

how to write code for z transformer

Create an array of strings, Create an array of Strings and fill it with som...

Create an array of Strings and fill it with some interesting text, such as vacation destinations, album names, or weapon names from a CRPG. Display three elements of the array on t

Define the processing of a structure, Define the Processing of a Structure?...

Define the Processing of a Structure? The members of structure are typically processed individually as separate entities. So we must be able to access the individual structure

Struct items, how to make a program this struct items/product

how to make a program this struct items/product

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd