aboutsummaryrefslogtreecommitdiffstats
path: root/ee2301
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-10-15 10:43:42 -0500
committerRossTheRoss <msattr@gmail.com>2019-10-15 10:43:42 -0500
commit7783b6106088e6b42b6c672d2924636d30d1588b (patch)
tree5510588529102cdf0710f26e5339ba3b1f673f2f /ee2301
parentFunstuff (diff)
downloadhomework-7783b6106088e6b42b6c672d2924636d30d1588b.tar
homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.gz
homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.bz2
homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.lz
homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.xz
homework-7783b6106088e6b42b6c672d2924636d30d1588b.tar.zst
homework-7783b6106088e6b42b6c672d2924636d30d1588b.zip
I should probably pay attention
Diffstat (limited to 'ee2301')
-rw-r--r--ee2301/baseConvert.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ee2301/baseConvert.cpp b/ee2301/baseConvert.cpp
index 486a68f..d675741 100644
--- a/ee2301/baseConvert.cpp
+++ b/ee2301/baseConvert.cpp
@@ -2,6 +2,7 @@
// to decimal
#include <stdio.h>
#include <string.h>
+#include <iostream>
// To return value of a char. For example, 2 is
// returned for '2'. 10 is returned for 'A', 11
@@ -47,7 +48,9 @@ int main()
{
char str[] = "11A";
int base = 16;
- printf("Decimal equivalent of %s in base %d is "
+ printf("Please enter number followed by base: ");
+ std::cin >> str >> base;
+ printf("Decimal equivalent of %s in base %d is"
" %d\n",
str, base, toDeci(str, base));
return 0;