Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Menu Driven String Editor

  1. Sep 30, 2006 #1
    I'm having some trouble writing the menu part of this program. Right now, I have everything in main() just for ease of compiling. The file is attached.

    There are 5 basic commands: I, D, L, A, E
    I = insert a line, D = Delete a line, L = list a line, A = Append to end of list,
    E = exit.
    Thats easy. The hard part is that a line number may follow the command.
    I 5 means insert a string that follows before line 5.
    D 5-13 means delete lines 5 through 13.
    L 3 - 7 means list lines 3 - 7.

    If text follows the numbers then it is considered a string and not a command.

    I bring in the line using cin.getline(newString, 255, \n). newString is of type char. I'm not sure what to do with the loop to determine if there are numbers, then if the line is more than one digit ( 20 ) how do I push them together to represent the line number, AND then if there is letters after the numbers its a string... its all so confusing!

    Please help me get through this!!! :eek:

    thank you so much for your help!

    Trista
     

    Attached Files:

  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: Menu Driven String Editor
  1. Hex editor (Replies: 16)

  2. Free HTML editors? (Replies: 7)

  3. Record Menu (Replies: 0)

  4. Text Editor and Complier (Replies: 13)

Loading...