为什么无法运行
#include
#include
#include
#include
#include
using namespace std;
char *strcat(char a[],char b[])
{
char *pa=a;
while(*pa!='\0')
{
pa++;
}
while(*b!='\0')
{
*pa=*b;
b++;
pa++;
}
*pa='\0';
return a;
}
int main()
{
char string3[60];
char strPtr;
char *s=strcat(string1,string2);
char a[60]="there are 100 students in the class room." , b[60]="they study very hard." , c[200];
char *s=strcat(a,b);
puts(s);
return 0;
}
string1,string2和s全都没定义
string3,strPtr,c全都没用上
char *s=strcat(string1,string2);
这里string1和string2哪来的?
@Override
public void selectSort() {
int index, temp;
//n-1趟的简单排序
for (int i = 0; i < length; i++) {
index = i;
//在无序区查找最小记录,并置于新有序区最后一位
for (int scan = i+1; scan < length; scan++) {
if (record[scan] < record[index]) {
index = scan;
}
}
if (index != 1) {
temp = record[i];
record[i] = record[index];
record[index] = temp;
}
}
}