Thursday, July 9, 2009

Using C language (not C++) to write...?

Using C language to write a function Escape(s,t) that converts characters like newline and tab to visible escape sequenceslike \n and \t as it copies the string t to s. Use a Switch (all code, include main () function is convenient) thank!

Using C language (not C++) to write...?
In order to print an escape code (i.e. "\n") instead of actually inserting, in this case, a "new-line", you simply add another '\' in front of it. So if you did "cout %26lt;%26lt; "\\n";" it would actually print "\n".





But why are you using C? If it's a personal project, not school assignment, you should go with C++ instead, but it sounds to me like a homework assignment, therefore I will not just give you the answer in entire code. But go by what I've said.
Reply:And I should do your work for you why? If you are stuck on a specific problem, please ask a specific question. Throwing a problem out there and hoping the "code fairy" will do it for you teaches you nothing and shouldn't even be thought of if you're being paid to do this. In short, do your own work!

calling cards

No comments:

Post a Comment