| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1033 人关注过本帖
标题:初学者求助解答几个C++编程
取消只看楼主 加入收藏
迷途小羔羊
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-11-5
收藏
 问题点数:0 回复次数:1 
初学者求助解答几个C++编程
1. (Occurences of a specified character) Write a function that finds the number of occurrences of a specified character in the string using the following header:
    Int count(const char * const str, char a)
For example, count(“Welcome”, ‘e’) returns 2.
prompt the user to enter a string and a letter


2. (Hex to decimal) Writer a function that parses a hex number as a string into a decimal integer. The function header is as follows:
    Int parseHex(const char * const hexString)
For example, hexString A5 is 165 (10x16+5=165) and FAA is 4100 (15x16^2+10x16+10=4100). So, parseHex (“A5”) returns 165 and parseHex(“FAA”) returns 4100. Use hex strings ABC and 10A to test the function.
prompt the user to enter a hexadecimal number


3. (Sorting characters in a string) Write two overloaded functions that return a sorted string using the following header:
    Char * sort(char *s)
    Void sort(const char * const s, char * s1)

For example, sort(“acb”) return abc.
you will have to allocate memory for the sorted array
搜索更多相关主题的帖子: 解答 
2008-11-05 00:14
迷途小羔羊
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-11-5
收藏
得分:0 
看了这个终于有点头绪了````谢谢阿!!!!
2008-11-05 23:16
快速回复:初学者求助解答几个C++编程
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024870 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved