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
padovan string for natural numbers program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class Padov

Prepare Windows Shell Extension Project Description: Skills required are C++ Programming, Windows Desktop, Windows API

2-D Array- C program: Define a two dimension array using c. void convert ( int a[10][10] , int[] , int , int); void main()   {   clrscr();   int a[10][10], b[10

A PROGRAM TO CALCULATE AREA OF TRIANGLE

M em b e r d e r e f e r e n c i ng o p e r a t o r s: T h e s e op e r a t o r s w i l l b e d i s c u s s e d l a t

write a program that calculates points along a rhodonea curve.... ? int fillArray( double data[ ], int nValues, double min, double max ); o Used to fill in the theta array. Return

Define hash functions. Explain the Division method, Mid square method and Folding method of hash functions.

5 questions. plus i will provide the "vector.h" for the questions that needs it

Many modern cryptography algorithms require two numbers that are coprime, or sometimes referred to as relatively prime. Two numbers are coprime if their greatest common divisor is

to compute the net pay of an emplyee, given his/her pay rate, number of hours and tax rate