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

Explain function templates, Function Templates Function templates give ...

Function Templates Function templates give you with the capability to write a one function that is a skeleton, or template, for a family of similar functions. In function ov

Linking source code in vc++ 6.0, i have a project in BDD(Binary Decision Di...

i have a project in BDD(Binary Decision Diagram).. where i have to use BDD library...i m using cudd package which uses BDD technique...i download cudd package..try to run in vc++ 6

Rules of function, Rules of function: Inline function created witho...

Rules of function: Inline function created without prototype it reduces the memory and it is used only for small function. Inline function cannot have recursion, static var

Basic Programming Constructs, Write a program to print all the factors of a...

Write a program to print all the factors of a positive integer A

UltimateCarRadio Project, In this assignment, you will be modifying your As...

In this assignment, you will be modifying your Assign-05 code to use more inheritance. As well, in this assignment, you will be asked to use newand delete, throw and catch except

Padovan string, padovan string for n natural numbers p(n)=1,p(n)=2,p(n)=3 a...

padovan string for n natural numbers p(n)=1,p(n)=2,p(n)=3 and use padovan formul to get output 1

Define the data type modifiers in c language, Define the Data Type Modifier...

Define the Data Type Modifiers in C language? There are three data types(int, float & double) above have the following modifiers. 1. short 2. long 3. signed 4. unsigned

Board coloring, in this problem u given a board in which some of the eleme...

in this problem u given a board in which some of the elements are placed as shown in diagram below .each element represent a color .fill the other elements in the board such that n

Define the bitwise operators in c language, Define the Bitwise Operators in...

Define the Bitwise Operators in c language? C has distinction of supporting special operators that known as bit wise operators for manipulation of data at bit level. These oper

Display an array using standard input, Stage One Define the specification o...

Stage One Define the specification of the program            Add two nxm size matrices   Stage Two Divide the program up into separate modules           Input Matrix         Ad

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