Hey guys, this is my solution to a simple problem and I was looking for some feedback on my code. Please post any criticism you may have about it. //Test project for string to binary conversion// #include <iostream> #include <string> using namespace std; void binConvert(string ConvertMe){ int ArraySize = ConvertMe.length(); int* asciiArray = new int [ArraySize]; int binValues[8]; int decValues[8] = {128,64,32,16,8,4,2,1}; // Convert each char of ConvertMe into its ascii value for(int i = 0; i < ArraySize; i++){ asciiArray[i] = ConvertMe[i]; } // Convert asciiArray values from decimal to binary and output to screen for(int i = 0; …

Member Avatar
Member Avatar
+0 forum 4

Hey guys, I've been working on a little project of mine, and part of it requires sorting. I'm using bubble sort and before I put the algorithm in the code, the program ran fine. void ranking(){ int count = getcount("all"); // get total members and save value to count int* pArray = new int [count]; string names[count]; // why can't I dynamically allocate memory to string arrays? // Get member names for point checking and sorting string name; ifstream members("members.txt"); for(int i = 0; i < count; i++){ members >> names[i]; } members.close(); // Get total points for each name …

Member Avatar
Member Avatar
+0 forum 3

Hey guys, as the title says, this is my first encryption program. Being extremely simple, I was just looking for advice on ways I could improve it. I just recently got back into programming(I tried to learn before but unfortunately lost interest while I was still learning the basics) and would appreciate any advice and/or criticism you could offer. Thanks. #include <iostream> #include <fstream> #include <string> using namespace std; // encrypts clear text string int encrypt(string x){ int size = x.length(); int ascii[size - 1]; int change = 1; string hash; // converts the chars of string x into its …

Member Avatar
Member Avatar
+0 forum 13

Hey guys, I just started learning HTML/Javascript yesterday and I just wanted to mess around a bit. I'm working on a few things dealing with user input but I've come accross a little snag. I want it to take in 3 inputs, do an operation, and then output the answer. Equation: (x + y) / z = a. To test it, I input the same number for x, y, and z because that's supposed to give me a = 2. The problem is, it doesn't. Depending on the number input for all three variables, the output changes.(e.g. x,y,z = 10 …

Member Avatar
Member Avatar
+0 forum 6

Hey guys, I just started learning HTML/Javascript yesterday and I just wanted to mess around a bit. I'm working on a few things dealing with user input but I've come accross a little snag. I want it to take in 3 inputs, do an operation, and then output the answer. Equation: (x + y) / z = a. To test it, I input the same number for x, y, and z because that's supposed to give me a = 2. The problem is, it doesn't. Depending on the number input for all three variables, the output changes.(e.g. x,y,z = 10 …

Member Avatar
Member Avatar
+0 forum 3

I'm writing a program that will keep track of every Anime/Manga I watch/read(I'm an avid fan). I'm trying to make a database in order to keep track of all of the titles of the Anime/Manga. My problem is that when i try to add a new title to the existing list, it overwrites the entries that are already there. Here is the code for my add function. int Add(void) { outfile.open("database.txt"); cout << "What is the title of the Anime/Manga that you wish to add?" << endl; cout << "::>"; cin >> Title; outfile << Title << endl; outfile.close(); } …

Member Avatar
Member Avatar
+0 forum 2

Hi. I am 14 years old, currently a freshman in high school. I love anything and everything about computers. I recently took up programming(C++, C#) and i love it. When i'm not on a computer i like to hang out with my friends, go to the movies, play baseball, and listen to music. A lot of people tease me about it, but i love classical music. My favorite is Bach. I also listen to almost anyothe type of music, except metal.

Member Avatar
+0 forum 0

The End.