我编译我的代码没有任何错误.但是,当我尝试运行该程序时,会弹出一个包含以下内容的窗口:
Program: C:\Windows\SYSTEM32\MSVCP120D.dll
File: c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstring
Line: 1168
Expression: invalid null pointer
Run Code Online (Sandbox Code Playgroud)
我不确定问题是什么或它可能是什么.我绝对肯定地知道标题非常好,因为它是由教授提供的,我们不会触及它.
意图
代码的目的是从用户获取二进制输入并显示十进制等效值.然后取十进制输入并将其打印为二进制数.
码
主要
#include "stdafx.h"
#include "LinkedStack.h"
#include <string>
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
string binaryNum = "0"; // Holds the entered binary value
string decResult = "0"; // Holds the decimal result
int binResult = 0, pow = 1; // Holds the binary result and the power of 1 for conversion
int decimal = 0; …Run Code Online (Sandbox Code Playgroud)