一个简单的帮助........ [英] One simple help........

查看:72
本文介绍了一个简单的帮助........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是ANSI C的新蜜蜂,任何人都可以为我解决这个问题,这样我就可以理解它的每一行都把时间放进去了,我真的很想让ANSI C在我脑海中如此友善帮帮我 。

欢呼。





具有以下原型的功能


Char * mystrcat(char * s,char * p);


函数将字符串p附加到字符串s的末尾并返回指向开头的字符串字符串s。

请记住字符串以二进制零结尾(?\0?)。


假设字符串s包含?abcd?和字符串p包含?xyz?。结果是字符串s包含?abcdxyz?。


使用下面的程序部分来测试你的程序:

#include< ctype.h>


char * mystrcat(char * s,char * p);


main()

{

Char string1 [80],string2 [80];

For(;;)

{

Printf(?输入string1:?);

Scanf(?%s?,& string1);

If(!strcmp(string1,?done?))

休息;

Printf(?输入string2:?);

Scanf(?%s?,& string2);

printf(?String1:%s String2:%s \ n?,string1,string2);

Printf(?返回字符串:%s \ n?,mystrcat(string1,

string2);

Printf(?String1:%s String2:%s \ n?,string1,string2);

}

}


提示:ctestchar = *(ptrstring ++)?指定字符指针ptrstring到字符ctestchar并将指针移动一个字符。

hi all i am a new bee for ANSI C , can anyone solve the question for me please , so that i can understand each line of it wid puting time into it , i really want to get ANSI C in my head so kindly help me out .
cheers.





A function with the following prototype

Char *mystrcat(char *s, char *p);

The function appends string p to the end of string s and returns a pointer to the start of string s.
Remember that strings are terminated by binary zero (?\0?).

Suppose string s contains ?abcd? and string p contains ?xyz?. The result would be string s containing ?abcdxyz?.

Use the program section below to test your program:
#include <ctype.h>

char *mystrcat(char *s,char *p);

main()
{
Char string1[80], string2[80];
For ( ; ; )
{
Printf(?Enter string1: ?);
Scanf(?%s?, &string1);
If (!strcmp(string1, ?done?))
Break;
Printf(?Enter string2: ?);
Scanf(?%s?, &string2);
Printf(?String1: %s String2: %s\n?, string1, string2);
Printf(?Returned string : %s\n?, mystrcat(string1,
string2);
Printf(?String1: %s String2: %s\n?, string1, string2);
}
}

Hint : ctestchar = *(ptrstring++) ? assigns the character pointer to by ptrstring to the character ctestchar and moves the pointer on by one character.

推荐答案

Marsguy-


你试过什么这个?你有哪些与之相关的部分?


(如果你问一个问题,你更有可能获得帮助,而且看起来我们只是在做你的作业;))
Marsguy-

What have you tried on this? What parts are you having touble with?

(you''re more likely to get help if you ask a question, and it doesn''t look like we''re just doing your homework for you ;) )


我说我是一只新的蜜蜂,只有在我通过代码之后才能理解它。我诚实地说,而不是找借口。如果你不想帮助它那么好的朋友。
Well as i said that i am a new bee and will understand it only after i go throu the code for it . I was honest in saying it and not making up excuses . If u dont want to help then its ok friend.



好​​吧,我说我是一只新蜜蜂,只有在了解之后才能理解它我通过它的代码。我诚实地说,而不是找借口。如果你不想帮助那么好朋友。
Well as i said that i am a new bee and will understand it only after i go throu the code for it . I was honest in saying it and not making up excuses . If u dont want to help then its ok friend.



我不是说我不想帮忙,但是你没有问过任何问题,看起来你刚刚发布了你的作业问题,并且 - 对不起 - 我不会只是给你代码,但如果你尝试它,实际上有你自己的问题(比如我在哪里开始是一个有效的问题),然后我会非常乐意回应。如果你愿意学习它,我会尽一切努力帮助你做到这一点,但看起来好像你甚至没有费心去尝试这个问题,你只是想尽可能少地得到答案。尽可能努力。

I''m not saying I don''t want to help, but you have asked no questions, it looks like you have just posted your homework problem up, and - I''m sorry - I am not going to just give you the code, though if you try it, actually have your own question (like "where do i start" is a valid question), then I''d be more than happy to respond. If you''re willing to learn it, i will do everything I can to help you do that, but it looks as if you haven''t even bothered to try the question, you just want to get the answer with as little thought and effort as possible.


这篇关于一个简单的帮助........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆