char** split(char *c,char t)函数如何实现?比如c的内容为“dkjsa frf”,分割符为‘ ’即一个空格,得到结果为2字符串:dkjsa和frf
一道面试题,自己试了试,总觉得不对
哪位给个正确的实现?
一道面试题,自己试了试,总觉得不对
哪位给个正确的实现?
解决方案 »
- 求一个"地球绕太阳转,同时月球绕地球转"的程序
- 看看唐僧是怎样叫悟空起床的!!超强
- 无法定位程序的输入点XXXX于动态链接库XX.DLL上.
- 这个错误怎么改呀?unresolved external symbol "public: void __thiscall CWnd::SetWindowText
- 谁有非线性最小二乘法的VC++代码,急用
- Select 函数疑问 欢迎大家指教
- 创建一CRichEditCtrl类,不能显示中文
- 如何让CButton控件支持右健,即右击Button时弹出右健??
- VC++调用c#中的类
- 自从上过某一网站后,IE浏览器最上方的标题栏总会显示他加上的文字!如何才能去掉!
- 关于取字符问题??? 右取
- 怎样对目录进行重命名?
/* STRTOK.C: In this program, a loop uses strtok
* to print all the tokens (separated by commas
* or blanks) in the string named "string".
*/#include <string.h>
#include <stdio.h>char string[] = "A string\tof ,,tokens\nand some more tokens";
char seps[] = " ,\t\n";
char *token;void main( void )
{
printf( "%s\n\nTokens:\n", string );
/* Establish string and get the first token: */
token = strtok( string, seps );
while( token != NULL )
{
/* While there are tokens in "string" */
printf( " %s\n", token );
/* Get next token: */
token = strtok( NULL, seps );
}
}Output
A string of ,,tokens
and some more tokensTokens:
A
string
of
tokens
and
some
more
tokens