General C++ Programming - October 2017 (Page 3)

Need some help in reading from a file...
 
Hi guys , I have a problem in reading a name and followed by scores from a file . my file is student.txt 78541/14 Jon Adam 85.0 78.5 89.0 12345/11 Jesson B...
[3 replies] Last: in my course we did not reach structure topic , only functions , arra... (by Chervil)
Where is my mistakes? Especially in the calculation process.
 
#include <iostream> #include <conio.h> #include <math.h> #include <iomanip> using namespace std; main () { char name , typeRoom; int numDay, priceRoom; fl...
[2 replies] Last: Thank you, you help me a lot. (by juniorM)
Matrix creation and outputting it to the screen
 
Hello! I was trying to create to functions one to create matrix and other is to output it. User needs to enter N, which is the size of the matrix, but by some r...
[1 reply] : line 32: change it to pass the parameter I would suggest you to use ... (by Hengry)
The Most Repeated Character In a String - Google Interview Question
 
I am starting to practice programming puzzles to prepare myself for my future interview questions. I saw a question on YouTube about finding the most repeated ...
[11 replies] Last: > I believe std::unordered_map has O(n) lookup. In pathogenic cases. ... (by Duthomhas)
Debugger not properly working... could this be a problem in my code?
 
I've always thought that static arrays can't be passed by value in C++. If you just type an array parameter definition without the & operator, it will still be ...
[2 replies] Last: > I've been suggested that my code is wrong but I don't see why. I don... (by ne555)
by recuva
Hey guys, need some help with program
 
So, I got to write program which lets you to choose number between 1 and 9 and writes down all two-digit numbers which contains that number. For example I writ...
[1 reply] : You do not necessarily need to split the number. Much of what you need... (by knowclue)
A shopping cart : Design issues & enhancements.
 
Hi All :), I am working on designing a basic shopping cart and below is my design approach. I would be glad to know the shortcomings of the below design and s...
[4 replies] Last: Thanks @coder777 for pointing out this. I think I'll need to have a fa... (by kapil2905)
New Free C/C++ Online Java IDE
 
Dear all, My name is David. We've created several years ago the site browxy to run and compile java code. Now after many years of work we released a new vers...
[no replies]
by EgorVv
system("...");
 
int main() { system("c++ -c \"Data Package\"\\DataWorker.cpp"); } Hello, I guess that this code is logical BUT the compiler doesn't want to open the f...
[2 replies] Last: thanks for the help (by EgorVv)
Validation Loop Help
 
Hello, I'm not looking for you to write the code for me, I'm just looking to be pointed in the right direction. If you could provide a template or give some tip...
[4 replies] Last: At risk of repeating wildblue, in C++, indentation carries no meaning... (by Repeater)
Storing color in a vector
 
i would like to iterate through different colors. is it possible to store a color names in a vector like bellow vector<string> color= { "blue","black","white",...
[1 reply] : Have... you tried it? (by Duthomhas)
How to properly call a vector from a class?
 
Hello! I am making a Pokemon Battle Simulator in Visual Studio 2017, where I am having troubles on lines 198 - 205. I am trying to call a vector from the class ...
[5 replies] Last: @Ninjacop Just some other ideas to improve your code a bit: Consider... (by TheIdeasMan)
by kenway
Confused on Addresses and Constructors
 
I understand the basics of the two pretty well. But I was given code to work on and am completely confused on how to work with it. This is what I'm given: Roma...
[1 reply] : Why is there an & after the string? It's a reference, conceptually... (by TheIdeasMan)
by HArray
Strange execution C++ code. Any ideas ?
 
I have two versions the same code (10 million iterations): First version. bool HArrayFixRAM::insert(uint* key, uint value) { if (pLastContentCell + RowLen >...
[2 replies] Last: I am not sure, but probably I realized what happens. This condition ch... (by HArray)
Vector Accessor Method
 
Hello! I was having trouble making an accessor method for a vector of the class below. How would I do it? class Pokemon { public: //constructor with all...
[7 replies] Last: @Ninjacop Think about it for a second. To return name in your attack c... (by knowclue)
ios_base::openmode binary
 
Josuttis states the following about the binary openmode: The flag binary configures the stream to suppress conversion of special characters or character ...
[1 reply] : > The question is, shouldn't this instead read "In normal text mode (i... (by JLBorges)
by tmnt
Void Function
 
Hello all!! Ive tried completing this problem but Im not sure how to use the void function. Also Ive had trouble using the if else statements with char /// Th...
[3 replies] Last: OK. Now look at what you've actually written. Can you tell me under ... (by MikeyBoy)
std::map and std::vector containers
 
Hello all, The container std::vector uses an array and for searching it starts from the beginning to the desired element or to the end. The price is said to ...
[7 replies] Last: And what should be under operator () ? Wait a minute, HArray with 8 th... (by HArray)
by plexus
Good examples for ? :
 
I'm helping a friend to learn C++. But when it comes to the ?: operator, he's like "what do I need that thing for". So, I'm looking for some good examples w...
[4 replies] Last: The fundamental difference is that the if-else statement is not an ... (by JLBorges)
How to store/call an object through a variable?
 
Hello! I am trying to write a Pokemon Battle program, where I am having trouble. I am trying to get the user's input of a Pokemon (object) and store it in a var...
[4 replies] Last: Oops, sorry! (by Ninjacop)
October 2017 Pages: 12345... 16
  Archived months: [sep2017] [nov2017]

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