Find Jobs
Hire Freelancers

Write a program that simulates the search and replace operation in a text editor.

$2-8 USD / hour

进行中
已发布大约 11 年前

$2-8 USD / hour

Write a program that simulates the search and replace operation in a text editor. The program is to have only three function calls in main. The first prompts the user to type a string of 80 characters, then prmpts the user to search a substring of 10 or fewer characters, finally it prompts the user to type the replace substring of 10 or fewer characters. The second call is the search and replace function, which replaces all occurences of the search substring with the replace substring and creates a new string. If no occurrences are found it returns the original string. The new string culd be 800 characters long (80 identical characters replaced by 10 characters each). Your function must be able to handle overfow by using the realloc function to exten the new string when neccessary. Start with an output string of 80 characters then extend by 80 when necessary. the function returns the adress of the new string. After the search and replace function returns, a print function prints the resulting string as a series of 80 character lines. It performs word wrap. That is a line can end only at a space. if there is no space in 80 characters then print 79 characters and a hyphen and continue on the next line. rune the program at least three times: a. first run it with no substitutions in the original input b. second run it with two or more substitutions c. finally run it with substitutions that cause the output to be at least three lines one of which requires a hyphen.
项目 ID: 4295388

关于此项目

1条提案
远程项目
活跃11 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
good luck for both of us
$2 USD 在10天之内
5.0 (3条评论)
1.6
1.6

关于客户

UNITED STATES的国旗
san jose, United States
5.0
43
付款方式已验证
会员自5月 31, 2012起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。