General C++ Programming - September 2018 (Page 5)

by JM567
Assigning Char Array to Value
 
Hello I am having trouble declaring a variable "answerArray" in my structure for my code. This is the code I have written: struct Scantron { char Name ; ...
[5 replies] Last: C structs with C strings are easier and more efficient to serialize an... (by jonnin)
Ambiguity while moving seekg()
 
I am having the followimg warning on Dev-C++. ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst ...
[1 reply] : // seek to -std::streampos{sizeof ah} bytes before the current input ... (by mbozzi)
by Dum
Table game
 
Can anyone give me a hint to solve this question. Alice and Bob are playing a game with a (N+1)×(M+1) table. Let's denote the cell in the i-th row and j-th co...
[9 replies] Last: ¿what pattern did you observe? (by ne555)
Stacks
 
Hello, I need to use 10 numbers (ex. 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10) and put them into an all numbers stack, even stack, and odd stack. This is how far I’v...
[5 replies] Last: #include <iostream> using namespace std; template <typename T, size... (by tpb)
by JM567
Trim Field of Spaces for Incoming Text File
 
Hello. I'm having a lot of trouble with trying to write the syntax for one of my codes. I need to: "Remove trailing spaces from fieldIn cstring and place in fie...
[2 replies] Last: I want it to erase all the necessary spaces and replace it with one sp... (by JM567)
by JM567
Call function from function - how to pass correctly
 
I'm having a lot of trouble with trying to write the syntax for one of my codes. The main problem I'm having is calling the trimField() function The trimF...
[2 replies] Last: I had to redo it because my question changed, and so the first title w... (by JM567)
by froyd
C++ Program that will be able to ask the user the coefficients of 4 linear equations.
 
newbie here, my teacher gave this activity C++ Program that will be able to ask the user the coefficients of 4 linear equations. thanks
[5 replies] Last: thanks keskiverto, I will try to do this, any idea for a start is re... (by froyd)
by mbozzi
C++17 "using" syntax with commas
 
Since C++17, instead of saying using a; using b; , we can just say using a, b; . I make this typo all the time, but it's not a typo any more. Neat....
[1 reply] : Thank you, I did not know this :) (by Ganado)
by JM567
Open Two Files Using Same In Stream
 
Hello! I am working on a lab for my class, and I am having trouble with File I/O. I need to open two files, "datafile1.txt" and "datafile2.txt", and pass them...
[1 reply] : Do not doublepost (create multiple threads about same problem). That s... (by keskiverto)
Stacks
 
Hello, I am having trouble getting my original value of an int that I use in a while loop and cant seem to display the rest of the base numbers. #include...
[3 replies] Last: Okay, should I sent n equal to another variable (for example: int n2 ... (by Repeater)
I'm having trouble with my work some assistance would be appreciated
 
Write a program that reads two fractions such as 1/2 and 1/4 and computes and stores the sum, the difference, the product and the result of dividing one by the ...
[1 reply] : > Write a program that reads two fractions // Prompt user for the ... (by ne555)
TicTacToe C++
 
Hi, I have problem when I run the program and select the symbol and then select the spot to move into. tell me this spot already taken please if some one could...
[1 reply] : missing headers, post a compilable example. (by ne555)
Vigenere Cipher
 
Hi Any idea how I could make a Vigenere cipher to only use ascii characters ranging rom 32 to 126 ? So if I pass the encode function a 'T', how could I e...
[18 replies] Last: Alrighty. So i managed to get the codeword to be the length of the p... (by parallx)
How to read data in files and extract numbers?
 
I have some data stored in a file formatted like this (yes it is a result from OpenFOAM): FoamFile { version 2.0; format ascii; cl...
[2 replies] Last: @lastchangce thank you for your reply I am learning OpenFOAM and C++ ... (by dianafred)
using pointers to populate a dynamic array
 
I am learning C++ and I have an assignment that asks me to write a program that reads in data from a text file and stores the data in a dynamic array. I must pa...
[9 replies] Last: it's always the simplest little things that get past me. Thank you so ... (by Carlos2047)
Avoid halting the program with getline()
 
I'm writing a program which needs to be able to read data from stdin with getline(), cin or some other method, but only if there IS something to read. Otherwise...
[12 replies] Last: It is very much possible to do this, but it requires OS-specific code ... (by Duthomhas)
How shall I implement this for larger numbers?
 
Consider the following algorithm, which generates a (not necessarily uniformly) random permutation of numbers 1 through N: P := [1, 2, ..., N] for i in 1..N...
[4 replies] Last: plzz give me the output for n=4,n=5,n=6 maybe i'll give you the whole ... (by ffloyd)
where are values coming from ?
 
Have a .cpp/.h: .h class camera_param { public: camera_param(); void set_cam_vars(cv::SimpleBlobDetector::Params); void print_cam_vars(cv::SimpleBlobDet...
[11 replies] Last: Don't know what the problem was, but the program is functioning just f... (by technologist)
C++ to Excel VBA
 
Hi need a Excel VBA version of the following code. //#include <Rcpp.h> //#include <math.h> //#include <iostream.h> using namespace Rcpp; double qnormal...
[2 replies] Last: everything I see in this program is doable in excel, with pretty much ... (by jonnin)
For loop executes but does not seem to be calculating correctly
 
Following code when executed does not appear to be calculating correctly? Any advise would be greatly appreciated. #include <iostream> #include <cstdlib> usi...
[1 reply] : Hello, Please use code tags when posting. int purchasePrice; int p... (by alonso12)
September 2018 Pages: 1... 34567... 9
  Archived months: [aug2018] [oct2018]

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