I am doing C++ programming course and need some help on this assignment.
The assignment is to get strings from the user until end comes up and then return the longest string i am stuck and not sure where to go. Here is the little that I have done.
/* File: longStr.cpp
* This program reads a list of words until "end"
* appears and return the longest string.
*/

#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
#include "strlib.h"

main()
{
string firStr, lonStr;
int num, lon;

printf("Please enter list of strings.\nAs a sentinel value use end\n");
firStr=GetLine();
lon=0;

while(!(StringEqual(firStr, "end")))
{
firStr=GetLine();
num=StringLength(firStr);
lon=(lon>=num)? lon : num;
printf("%d\n", lon);
}
}