General C++ Programming - April 2019 (Page 3)

Compilation errors
 
I am a Java programmer migrating to C++ and I am having occasional difficulties understanding the differences between references and pointers. I am getting a co...
[8 replies] Last: I thought java had added the ability to have subroutines? Does it STI... (by jonnin)
Double free or corruption memory dump
 
When compiling my program, I continue to get this error message: "***Error in `./TwoSum': double error or corruption (fasstop)...". I don't know how to read ass...
[13 replies] Last: For some reason I thought it would run in O(log n) but that doesn't ma... (by vaderboi)
Undefined Symbols
 
I'm trying to create a linked list but I get that error always. I separated it into .hpp and .cpp files, and thats where the problem lives I guess, the error I ...
[3 replies] Last: More specifically, you have to: - compile each source code file to an ... (by MikeyBoy)
by bonho
smart pointers
 
I am writing a program with two parts. (A) sends an object to (B) which stores it, and once sent, (A) can only modify part of that object. I am stuck with poi...
[5 replies] Last: Thanks, I'll try it out (by bonho)
by turqo
Extract char elements from vector string
 
what is wrong in this : (really helpful if someone explains concept thanks : ) ) #include <iostream> #include <vector> #include <string> using namespac...
[3 replies] Last: THANKS GUYS (by turqo)
by rsp19
Debug assertion failure
 
I'm new to C++ and I'm having trouble with a debug assertion failure. It appears each time I try to run the program. It reads: Expression: string subscrip...
[1 reply] : Don't double-post. http://www.cplusplus.com/forum/beginner/252630/ (by helios)
Linked List
 
How do you add a new_Node directly behind the last_Node in a circular linked list when it is full? Would it be like this: Queuenode * new_Node = new Link (...
[14 replies] Last: void Display(std::ostream& os) const { if (Empty()) return; Queueno... (by dhayden)
by Ilfau
C++ reading, writing errors
 
Hi everyone, I am struggling with a program. It shows my file reading and writing (ifstream and ofstream) as errors and I can't understand why. Any ideas? (I le...
[5 replies] Last: Yeaah, thank you so much (by Ilfau)
by zapshe
Assigning array with .length() ?
 
int main() { std::string word = "This"; bool arr[word.length()]; } This works fine on onlinegdb.com but gives the error "expression must have a constant...
[9 replies] Last: Sorry to reply late, thanks for the advice jonnin, very appreciated ^/... (by zapshe)
Console prints blank space and is not supposed to do so
 
So I'm writing a code for my final project and I just encountered a problem This code snippet prints an extra blank line but that was ok until... I had to st...
[3 replies] Last: Thank you very much @JLBorges solved the issue (by ammar629)
How Can I Directly Use The Iterator Values?
 
Hello Professionals: Good day. I am honestly a newbie of std::vector and I would like to know how can I convert my previous program into a new one? My old prog...
[1 reply] : std::unordered_map<glm::ivec3, float>::iterator a, b; a = b = g_polCo... (by ne555)
How To Properly Input Values in SGESV?
 
Hello Professionals: Good day. I was having a hard time to input the values in the SGESV function. So far, I have this kind of code: //Solve linear system ma...
[2 replies] Last: sgesv_( (integer*)&count_g_polCoeffGerald, (integer*)&nrhs, (real*... (by ne555)
C and C++
 
What are the differences between C and C++? 1) C++ is a kind of superset of C, most of C programs except few exceptions (See this and this) work in C++ as well...
[2 replies] Last: The OP is profile spam (by Repeater)
by Susie
I made a grid, what do you think about it?
 
Hello! I'm a beginner C++ programmer. Yesterday I made the grid below, it was difficult to make. ( I'm not used YET to the intensive thinking when you make a ...
[6 replies] Last: No problem, and I'll try to get suicide right the first time ^-^ Good ... (by zapshe)
How To Intentionally Assign Constant Value To Array?
 
Hello Professionals: Good day. I came across this problem when I attempted to assign a variable to an array. For example: std::unordered_map<glm::ivec3, floa...
[3 replies] Last: Thank you very much for your inputs everyone! :) (by kindgnice)
NEED HELP PLEASE!!
 
1). Open the file "project.txt" and read the data into an integer array. Below is the sample code to open and read data from an existing file. Note. You can als...
[13 replies] Last: Brandonjanda, with all the respect.. Asking other programmers to do al... (by Susie)
A Problem I've had for a "while"
 
Hey guys, this is a recurring problem I've had whenever I try to use the while loop. It says it expects a ';' before a parenthesis but it doesn't need one. I'll...
[2 replies] Last: In addition to what he said, if you really wants to do with while loop... (by Lucas Fiorini)
Visual Studio Error Help
 
I have changed the doubles to char's cause on visual studio it said it didn't complie the code. I have tried changing the doubles and changing it to floats and ...
[4 replies] Last: [quote=jlb]Where have you implemented your function double getInput(co... (by George P)
Creating a Library
 
Hello everybody, I'm planning to create my own data structure library. How is the best way to do so? Is is just creating .h files with it's respective implement...
[2 replies] Last: or, if you are just now getting started: a library is just code where ... (by jonnin)
BlackJack Simplified ASAP (1,2)
 
Please create a simple BlackJack code. DUE IN 12 AM NYC TIME!! Hit and stand options, must use classes, objects, public, private members. Human player versus co...
[21 replies] Last: I will not write ASAP next time "If you pull at the blades of grass i... (by MikeStgt)
April 2019 Pages: 12345... 9
  Archived months: [mar2019] [may2019]

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