标题:关于stract使用的问题
只看楼主
书生牛犊
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:星夜征程
等 级:贵宾
威 望:10
帖 子:1101
专家分:5265
注 册:2015-10-27
结帖率:93.75%
 问题点数:0 回复次数:1 
关于stract使用的问题

程序代码:
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main()
{
    ifstream infile;
    ofstream outfile;
    char name[20];
    char c;
    cout<<"please entra filename"<<endl;
    cin>>name;
    infile.open(name);
    if(!infile)
    {
        cout<<"failure"<<endl;
        exit(1);
    }
    cout<<"start copy"<<endl;
    stract(name,"copyfile");
    outfile.open(name);
    if(!outfile)
    {
        cout<<"can not copy"<<endl;
        exit(1);
    }
    while(!outfile.eof())
    {
        infile.get(c);
        cout<<c;
        }
    cout<<endl;
    infile.close();
    outfile.close();       

    return 0;
}
23    27    E:\CPP\数据结构\test.cpp    [Error] 'stract' was not declared in this scope

stract没定义应该是头文件的原因吧,但是我在头文件定义了cstring,这个相当于string.h

.

2016-08-12 16:35
书生牛犊
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:星夜征程
等 级:贵宾
威 望:10
帖 子:1101
专家分:5265
注 册:2015-10-27
得分:0 
已解决,是函数名拼写错了


strcat


[此贴子已经被作者于2016-8-12 16:50编辑过]


φ(゜▽゜*)♪
2016-08-12 16:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467805-1-1.html




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

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