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

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;



Posted Date: 10/19/2012 3:07:51 AM | Location : United States

Related Discussions:- Program to find a greatest string: c - program , Assignment Help, Ask Question on Program to find a greatest string: c - program , Get Answer, Expert's Help, Program to find a greatest string: c - program Discussions

Write discussion on Program to find a greatest string: c - program
Your posts are moderated
Related Questions
We are seeking a talented developer/team with great experience in programming apps for both Android and iOS. Our project needs great skills and experience in making good functional

Develop a biomedical imaging project Project Description: This is a biomedical imaging project. Skills required are C++ Programming, Cocoa, Mac OS, Objective C

Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele

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

palindrome program with minimum character replacements

how to create a shopping cart

Study the following table used to compute the tax payable by employees in certain organization   Gross Pay                                  Fewer than Three             Three

how to make basics strong and best logic skills what are the best way to be a expert programmer ? what counts a lot knowledge or practice?

Multidimensional Arrays - Every dimension is specified in separate brackets e.g. int arr[4][3]; This is a two-dimensional array with 4 as row dimension and 3 as