General C++ Programming - February 2020 (Page 4)

Write vector values into multiple files at once
 
Hello, I have the data in my vector. I am trying to write each vector value, say vector_name into "examplezero.h" , vector_name into "exampleone.h" and so on...
[2 replies] Last: #include <iostream> #include <fstream> #include <string> #include <ve... (by againtry)
Inputting batting average- expected unqualified id before << token???
 
Hi im new to programming and help would be greatly appreciated. Im recieving the error where it says string << "Enter Players name "; ??? // This program d...
[1 reply] : You need to add #include <string> for getline and string << "Enter... (by Yanson)
by ubaidm
Iterating a template pointer at compile time
 
Hi, I am trying to implement a circular array based Queue, i want my queue to be able to work on any data type, hence the data structure i used is a template. ...
[6 replies] Last: Your code looks much better. I have 2 questions for you. 1. Why add... (by doug4)
by wogoos
how to alias a struct of bitfields as a single byte
 
Below I use a struct containing struct members that mirrors the registers and status bits of a I2C AS6500 chip in SRAM memory. It all works fine except for on...
[1 reply] : Unfortunately, bit fields are a crapshoot. While they look pretty, the... (by Duthomhas)
Zero, one, two, Freddy’s coming for you
 
This post continues the series of articles, which can well be called “horrors for developers”. This time it will also touch upon a typical pattern of typos ...
[no replies]
How to separate numbers from a character?
 
Let's say that I have an input that is a pair of coordinate points: x,y . Two numbers, and a comma in between (no space). How would I separate the two numbers ...
[5 replies] Last: #include <iostream> using namespace std; int main() { char comma;... (by lastchance)
by Dee5
Breaking down of numbers
 
Hello guys, I'm working on a program which can help me split up a certain number into some sort of pieces. The pieces are 5000, 2000, 1000, 500, 200, 100,50. ...
[10 replies] Last: Bless you , thanks (by Dee5)
Custom TPM module start
 
C++11 if that is ok. CODE::BLOCKS 17.12 if that is ok. Baby level explaining if that is ok. I am new to C++. I am not even sure how to ask this, much less how ...
[1 reply] : Sorry, no code to supply as I do not even know where to start. If I... (by againtry)
by vojta
What number is used the most
 
Hi, I am doing program to read 5 numbers from user and outup the number that is used the most of the time. For example user input is 1,2,3,4,1 the output woul...
[8 replies] Last: Thank you very much. I appreciate that. (by vojta)
setfill function
 
hello: I am working on a programming assignment. I have everything for it done except the following: I am trying to use the setfill function to display ...
[3 replies] Last: That should work just fine then. (by salem c)
by Dee5
Declaration of negative values
 
Hello guys, My program works just fine but when I input negative integers it brings wrong output If product and sum of A and B it should print Gotcha If sum is...
[2 replies] Last: Thanks I've already solved it (by Dee5)
When is `this` a valid and fully-formed pointer?
 
When is this a valid and fully-formed pointer for proper usage in a constructor member initializer list ? Consider: class Parent { public: Pare...
[8 replies] Last: @Mbozzi Thank you! I appreciate the detailed answer! (by Aaron Vienneau)
Counting characters of each word in file
 
Hi, I am a beginner of c++ programming and I have a exercise to count characters of each word in file (.txt) and which length is most common.
[9 replies] Last: #include <fstream> #include <iostream> #include <string> using namesp... (by cirih)
Skipping Over Initial Prompt (Do/While)
 
At the end I give the user the option to rerun the program or exit it. I set up a do/while loop and it sort of works except it prompts straight away the name an...
[2 replies] Last: Worked thanks! (by fish692)
Keeping Correct User Input
 
I need the user to input a 7 digit number that will later be output back. If the user inputs a number shorter or longer, they will be prompted to re-input a 7 d...
[6 replies] Last: ohh my bad, i thought i was just writing which variable was going to b... (by fish692)
by Norej
problems reading from a file into a char arrray
 
#include <iostream> #include <iomanip> #include <cstring> #include <cstdlib> #include <fstream> #include <string.h> using namespace std; void getF...
[1 reply] : Since the first and last names are separated by a space why not just u... (by jlb)
Having problems with functions in C++
 
Hello, I am currently in my second year in university and we're studying about C++. I am not good at computer languages and I'm really desperate looking for som...
[2 replies] Last: I’ve no idea what your teacher asked you, but it could be a bit more... (by Enoizat)
Reversed array
 
I need to print the contents of an array both in the original order and after inverting its contents. My problem is doing the second part without using reverse(...
[2 replies] Last: How many elements are there in an array that has 0 elements? Your cod... (by keskiverto)
by vojta
expression must have pointer-to-object type
 
so my programs goes like this. i = 0; while (i < 5) { if (y < min) //expression must have pointer-to-object type { min = pocty ; } i++; ...
[4 replies] Last: That aside, what is the logical operation that you do in this: int mi... (by keskiverto)
Change values in .opf file via forms
 
Hi guys! I'm working on a small app (script editor) for a game called "The Outforce". This game has a .opf file that contains some kind of cfg files, picture...
[15 replies] Last: Here's the uploaded file: https://www.moddb.com/games/the-outforce/dow... (by HUNLevi)
February 2020 Pages: 1234567
  Archived months: [jan2020] [mar2020]

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