General C++ Programming - October 2016 (Page 7)

Anyone knows...??!!
 
So basically I was new in c++ Anyone know how to make string we input become like this: Ex: input: abc def ghi The output is: adg beh cfi Like that......
[10 replies] Last: #include <iostream> #include <string> #include <vector> int main( )... (by integralfx)
Lowercase to uppercase using ASCII
 
Hi Here I'm trying to load a coded message from a text file to decode it using ASCII. I take the first letter in the text file which is h and pass it to ch bu...
[2 replies] Last: Your answer didn't help but I figured it out. Thanks anyway (by overlord49)
binary search function
 
I have never written or seen a binary search function before, so how would I write one using vectors full of a file (the file is alphabetical)
[3 replies] Last: The defining characteristic of a binary search is that, each iteration... (by mbozzi)
Order form help:
 
Hi guys, I made a script that is suppose to be a customer order form. It works at the start but for some reason it will not let me type in my name. It goe...
[2 replies] Last: Thank you SakurasouBusters (500) code works. Noobish mistake, still ne... (by animation117)
Something wrong with my for loop?
 
I am writing a program where I need a for loop to run a certain amount of times, depending on user input. int num will be entered by the user. Everything is...
[1 reply] : I compiled your function along with a simple main function and I think... (by wildblue)
by CZZ
Vectors problem
 
Hi guys! I need to find the minimum distance between two points. For instance, I have two files composed by the initial and the final coordinates (x,y,z). ...
[1 reply] : In other words, you do have two sets of points, A and B, and you want ... (by keskiverto)
scramble user input
 
would this code scramble a word? i keep getting errors and im not 100% sure why. unsigned int scramble(unsigned int word) { int l = word.length(); string ...
[2 replies] Last: yes i believe so (by jessicacats)
by nusr
Trouble with Matrix
 
I need make a code with this output with the cicle for . 1 2 4 8 16 2 4 8 16 32 3 6 12 24 48 4 8 16 32 64 I have this code but is worng can you help me . #in...
[3 replies] Last: Unexpected output, I presume. Math trivia: (f*2)*(c*2) == f*2*c*2 ==... (by keskiverto)
How to use endl after if statement
 
I'm trying to make a blank line after my if statement, but for some reason it isn't making a blank like. I tried putting the cout << endl; in the statement and...
[4 replies] Last: you can also try cout << " " << endl; (by linny0107)
binary search for word in dictionary
 
I need to search for a word in a file and return if its in the file or not, but i'm not sure how to manipulate this code to do so, (this is from my teacher and ...
[no replies]
How can I make unordered_map to contain more types of objects (rectangle, triangle...)
 
As title says, how can I make my unordered_map to contain more types of classes like: Triangle, rectangle, circle... std::unordered_map<std::string, Object::...
[7 replies] Last: Thank you very much. (by Putarda)
memory leak help
 
When I run valgrind on my code, I receive one error on my insert method at operator new. I know this probably means that I have to delete node n somewhere, but ...
[3 replies] Last: > but I have been trying so many methods to delete it but they just gi... (by ne555)
comparing files and strings
 
I have to open a file that lists all of the names in our class and compare it to a file of names ranked by popularity and then output the class names with their...
[5 replies] Last: Yes, I can understand your frustration. One thing you could do is to... (by gunnerfunner)
i need a c++ program for the following problem
 
Write a c++ program that multiply the numbers. The program will receive multiplicand and multiplier one dimensional (1D ) OR two dimensional (2D) arrays. sho...
[6 replies] Last: [quote=integralfx]Maybe a "What have you tried so far?" would be bette... (by SakurasouBusters)
linker error by static member
 
Hello there, can someone say why I get a linker error by the subjacent example? X.h: #ifndef X_H #define X_H #include <vector> struct X { // s...
[1 reply] : Static members must be defined in a source file. Change your 'X.cpp' f... (by xismn)
Need help with some code
 
else if ((yAxis) != 0) is it possible to say that its not equal to 0 or 1, and if so how?
[1 reply] : is it possible to say that its not equal to 0 and 1, and if so how?... (by SakurasouBusters)
Structure/Array issues with index call
 
I am working on an assignment that requires the storing of employee information in a structure, and then an array. If the array is declared without set values, ...
[1 reply] : An array of your structure is accessed in the same way you would acces... (by jlb)
Inventory Class
 
I wrote this program but I am not sure how to run the program if i would like to run it again. I need your help. Please advice. #include <iostream> using ...
[1 reply] : Probably (because I haven't tried it): Move your do{ before the lin... (by lastchance)
by ISM34
Self Studying C++, Code will not compile issue
 
I am trying to write code for the following question: Write the definition of a function named fscopy that does a line-by-line copy from one stream to another....
[1 reply] : I am able to copy the input character by character, but I do not know... (by Nico)
What is going wrong in this program?
 
#include <iostream> #include <fstream> using namespace std; int b; class book { private: int bookno; char booktitle ; float price; float total_...
[2 replies] Last: After you get the book number there is '\n' left in the input buffer. ... (by vin)
October 2016 Pages: 1... 56789... 23
  Archived months: [sep2016] [nov2016]

This is an archived page. To post a new message, go to the current page.