我写了一个代码,在这个代码中我使用graphics.h,在borland c ++或visual我无法打开并运行它,现在我想运行这个代码,我有DOSBOX 0.72,如何用DOSBOX打开这段代码?我的窗户是7 32位
当我在八位数溢出后在c ++中使用float或double时,如何修复它?
这是我的代码:
#include <iostream.h>
#include <conio.h>
void main() {
double x;
cout<<"double : ";
cin>>x;
cout<<endl<<x;
getch();
}
Run Code Online (Sandbox Code Playgroud)
当cin = 123456789时,这是我的cout:123457e.08.
我的代码中有char的问题,请指导我(c ++).
我有这个错误:Run-Time Check Failure #3 - The variable 'op' is being used without being initialized.它是什么意思,我该如何解决?
这是我的代码:
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
using namespace std;
enum Operations {SIN1, COS1, TAN1};
void selectenteroperation(char *szInput) {
char *szLabels[3] = {"sin", "cos", "tan"};
int i=0;
while(strcmp(szInput,szLabels[i])==0)
++i;
switch (i)
{
case SIN1: { cout<<"SIN"; break; }
case COS1: { cout<<"COS"; break; }
case TAN1: { cout<<"TAN"; break; }
default: { cout<<"Wrong"; break; }
}
}
void …Run Code Online (Sandbox Code Playgroud)