C++找不到哪里出错了 高手帮忙看看
来源:百度知道 编辑:UC知道 时间:2024/09/24 01:54:20
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <time.h>
#include <string>
#include <cmath>
using namespace std;
void getFileName(ofstream &out);
void getMinMaxValue(int &min, int &max);
void getQuantity(int &qty);
void generateRandom(ostream &out, int qty, int min, int max);
int main(int argc, char *argv[])
{
ofstream out;
int min, max, qty;
srand(time(NULL));
getFileName(out);
getMinMaxValue(min, max);
getQuantity(qty);
generateRandom(out, qty, min, max);
system("PAUSE");
return EXIT_SUCCESS;
}
void getFileName(ofstream &out)
{
ifstream in;
char name[255];
cout<<"Please enter a file name: ";
cin>>name;
in.open(name);
if(in.fail())
{
#include <iostream>
#include <fstream>
#include <time.h>
#include <string>
#include <cmath>
using namespace std;
void getFileName(ofstream &out);
void getMinMaxValue(int &min, int &max);
void getQuantity(int &qty);
void generateRandom(ostream &out, int qty, int min, int max);
int main(int argc, char *argv[])
{
ofstream out;
int min, max, qty;
srand(time(NULL));
getFileName(out);
getMinMaxValue(min, max);
getQuantity(qty);
generateRandom(out, qty, min, max);
system("PAUSE");
return EXIT_SUCCESS;
}
void getFileName(ofstream &out)
{
ifstream in;
char name[255];
cout<<"Please enter a file name: ";
cin>>name;
in.open(name);
if(in.fail())
{
void getFileName(ofstream &out)
{
ifstream in;
char name[255];
cout<<"Please enter a file name: ";
cin>>name;
in.open(name);
if(in.fail())
{
char ans[100] = {0};/*内存需要初始化*/
bool again = true;
in.clear();
in.close();
cout<<"File already exists. Do you want to (O)verwrite, (A)ppend, or (Q)uit: ";
fflush(stdin);/*这句话一道这边来*/
cin.getline(ans,100);
while(again)
switch(toupper(ans[0]))
{
case 'O' : out.open(name);
again = false;
break;
case 'A' : out.open(name, ios::app);
again = false;
break;
case 'Q' : exit(1);
default : cout<<"Unknown command. Please re-enter"<<endl;
system("pause");
}
}
else
{
in.clear();
in.close();
in.open(name);
}
}
c语言程序高手帮我看看这个switch程序哪里出错了?
C 语言高手来。。帮我看下哪里出错了
请C高手帮我看看那出错了
会C语言的帮我看看哪里出错了
我开机总提示c:\windows\system32\wekcrd10.dll加载模块出错,找不到指定模块.请高手帮我解决写 谢谢了 啊
我开机总提示c:\windows\system32\pkpdrzaux.dll加载模块出错,找不到指定模块.请高手帮我解决写 谢谢了
我开机总提示c:\windows\system32\lsgvdu29.dll加载模块出错,找不到指定模块.请高手帮我解决写 谢谢了 啊
高手帮我看看哪出错了(关于C语言指针的)
哪位热心的大虾帮我看一下这段C代码啊~哪里出错了??
这道C程序哪里出错了啊?