由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - 问一个C++函数Parameter的问题
相关主题
C++ 初级再初级问题 (转载)问个剧土的关于Xcode的helloworld问题 (转载)
CPU 支持操作系统的问题 (转载)帮看看这段code (转载)
++ a faster or a++ faster in C?怎么找这个函数的源代码?
Help, install C++ compiler请问为什么这个程序会出现RunTime Error
想去CS读个MASTERA question when open a .chm file
请教一个基础C++问题 (转载)问一个关于批处理的问题,谢了! (转载)
Ph.D Openings in CS/CE for Spring/Fall 2013请教c++一个程序bug,谢谢前辈们
Java怎么不能用新的版本编译?问个VBA的问题
相关话题的讨论汇总
话题: filename话题: char话题: int
进入CS版参与讨论
1 (共1页)
b*********n
发帖数: 1258
1
想利用别人定义好的一个程序
int* LinearSuffixSort(char*& inputString, int& stringLength);
inputString is the pointer to the string to be sorted. stringLength is the l
ength of inputString.
===================
我的程序是这样的
#include "LinearSuffixSort.h"
using namespace std;
void main(int argc, char* argv[]){
char * fileName="abcdefg";
cout << LinearSuffixSort(fileName,7) << endl;
}
===================
Compile不通过
error C2665: 'LinearSuffixSort' : none of the 3 overloads can convert parame
ter 1 from type 'char *'
==
w****a
发帖数: 186
2

l
int iLen = strlen(fileName);
cout << LinearSuffixSort(fileName, iLen) < parame

【在 b*********n 的大作中提到】
: 想利用别人定义好的一个程序
: int* LinearSuffixSort(char*& inputString, int& stringLength);
: inputString is the pointer to the string to be sorted. stringLength is the l
: ength of inputString.
: ===================
: 我的程序是这样的
: #include "LinearSuffixSort.h"
: using namespace std;
: void main(int argc, char* argv[]){
: char * fileName="abcdefg";

b*********n
发帖数: 1258
3
这个我修改了
但是还是不行
我不知很明白char*& inputString是什么意思

the

【在 w****a 的大作中提到】
:
: l
: int iLen = strlen(fileName);
: cout << LinearSuffixSort(fileName, iLen) <: parame

a****1
发帖数: 61
4
no problem when you use:
char * fileName="abcdefg";
int L = strlen(fileName);
LinearSuffixSort(fileName,L);
At least I have just tested it on vc++2005.net

【在 b*********n 的大作中提到】
: 这个我修改了
: 但是还是不行
: 我不知很明白char*& inputString是什么意思
:
: the

b*********n
发帖数: 1258
5
1>Compiling...
1>msa.cpp
1>c:\program files\microsoft visual studio 8\vc\include\sys\time.h(126) : er
ror C4980: '__value' : use of this keyword requires /clr:oldSyntax command l
ine option
1>c:\program files\microsoft visual studio 8\vc\include\sys\time.h(126) : er
ror C3630: error when processing the token '__value'
1>c:\program files\microsoft visual studio 8\vc\include\sys\time.h(126) : fa
tal error C1190: managed targeted code requires a '/clr' option
1>Build log was saved at "file://c:\Doc

【在 a****1 的大作中提到】
: no problem when you use:
: char * fileName="abcdefg";
: int L = strlen(fileName);
: LinearSuffixSort(fileName,L);
: At least I have just tested it on vc++2005.net

a***n
发帖数: 1
6
int* LinearSuffixSort(char*& inputString, int& stringLength);
Modify the statement:
cout << LinearSuffixSort(fileName,7) << endl;
to
int i=0;
cout << LinearSuffixSort(fileName,i) << endl;
This is because the function prototype is
int* (char*& , int&);
Whenever you want to reference to som obj, you have to allocate memory for
that obj first.
D********g
发帖数: 650
7
const char*

l

【在 b*********n 的大作中提到】
: 想利用别人定义好的一个程序
: int* LinearSuffixSort(char*& inputString, int& stringLength);
: inputString is the pointer to the string to be sorted. stringLength is the l
: ength of inputString.
: ===================
: 我的程序是这样的
: #include "LinearSuffixSort.h"
: using namespace std;
: void main(int argc, char* argv[]){
: char * fileName="abcdefg";

G*O
发帖数: 706
8
inputString is a reference to a pointer pointing to a char.

【在 b*********n 的大作中提到】
: 这个我修改了
: 但是还是不行
: 我不知很明白char*& inputString是什么意思
:
: the

1 (共1页)
进入CS版参与讨论
相关主题
问个VBA的问题想去CS读个MASTER
用Python读csv文件header?请教一个基础C++问题 (转载)
[公告] CompSci 板的投票结果Ph.D Openings in CS/CE for Spring/Fall 2013
建议用open64Re: 改GCC 弄出一个特殊的Compiler,可能吗?Java怎么不能用新的版本编译?
C++ 初级再初级问题 (转载)问个剧土的关于Xcode的helloworld问题 (转载)
CPU 支持操作系统的问题 (转载)帮看看这段code (转载)
++ a faster or a++ faster in C?怎么找这个函数的源代码?
Help, install C++ compiler请问为什么这个程序会出现RunTime Error
相关话题的讨论汇总
话题: filename话题: char话题: int