469,649 Members | 1,643 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

String is left containing the data originally passed to the function?

Hello,

I have an assignment to do in class which requires me to create a
single line editor not a multi-line editor.

I am confused about what this means, I would appreciate any
clarification.

"IF "TB" is false (0): [single line edit]
Pressing TAB and ESCAPE will terminate the cio_edit(). If ESCAPE is
used, then editing is aborted - the string is left containing the data
originally passed to cio_edit();

Well, so far I have

case ESC_KEY:
if(!TB){end = 1;}
else{ //string must contain original data and forget
editing?}
break;

I am unsure if that is exactly what this assignment wants and how
abouts I would do that.

Thanks in advance.

Nov 15 '05 #1
3 1104
"AMT2K5" <Aa*********@gmail.com> writes:
I have an assignment to do in class which requires me to create a
single line editor not a multi-line editor.

.....

I am unsure if that is exactly what this assignment wants and how
abouts I would do that.

We, here, do not know.
The best approach will (surely) be to ask the instructor/professor who
is setting and grading the assignment.

--
Chris.
Nov 15 '05 #2

"AMT2K5" <Aa*********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hello,

I have an assignment to do in class which requires me to create a
single line editor not a multi-line editor.

I am confused about what this means, I would appreciate any
clarification.

"IF "TB" is false (0): [single line edit]
Pressing TAB and ESCAPE will terminate the cio_edit(). If ESCAPE is
used, then editing is aborted - the string is left containing the data
originally passed to cio_edit();
This implies to me that your edit function is modifying
the passed string 'in place'.

What your function will need to do is first make a copy of
the passed string. THen have it make modifications to the copy.
If the edit is not cancelled, copy the characters back to the
passed string, otherwise, don't.

Well, so far I have

case ESC_KEY:
if(!TB){end = 1;}
else{ //string must contain original data and forget
editing?}
break;

I am unsure if that is exactly what this assignment wants and how
abouts I would do that.


Well, the only way to know for sure is to consult with whomever
gave the assignment.

-Mike
Nov 15 '05 #3
"AMT2K5" <Aa*********@gmail.com> wrote in news:1128637420.381079.26390
@g43g2000cwa.googlegroups.com:

Hello,

I have an assignment to do in class which requires me to create a
single line editor not a multi-line editor.

I am confused about what this means, I would appreciate any
clarification.

"IF "TB" is false (0): [single line edit]
Pressing TAB and ESCAPE will terminate the cio_edit(). If ESCAPE is
used, then editing is aborted - the string is left containing the data
originally passed to cio_edit();

Well, so far I have

case ESC_KEY:
if(!TB){end = 1;}
else{ //string must contain original data and forget
editing?}
break;

I am unsure if that is exactly what this assignment wants and how
abouts I would do that.

Thanks in advance.


Hint:

memcpy(temp_storage, original_string, strlen(original_string));
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Kamilche | last post: by
9 posts views Thread by Albert Wagner | last post: by
7 posts views Thread by anonymous | last post: by
6 posts views Thread by AT | last post: by
232 posts views Thread by robert maas, see http://tinyurl.com/uh3t | last post: by
13 posts views Thread by Jennifer.Berube | last post: by
6 posts views Thread by JoeC | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.