Beginners - August 2020 (Page 6)

by StMick
Undefined Reference Error
 
Hello, When I compile this code I get an error message stating "undefined reference to Doctor::compare(Doctor)" - even though I've declared the compare funct...
[6 replies] Last: Thank you to all for the assistance. (by StMick)
by F95
Getting the wrong output after constructing a Red-Black tree from csv file
 
I'm tasked with opening a csv file, reading from the two columns, and mapping the values (name, number) to a red-black tree. We are to test adding the first 5 e...
[7 replies] Last: I know my logic in doing this is correct because starting the second ... (by jlb)
my rand() works only if i use a cout
 
Hi, i'm doing a function to "flip a coin" and every time i try to start the program it works fine only if the code has a casual cout. I'm using visual studio...
[2 replies] Last: Thanks now it works I hadn't really considered the time(0); (by MrNewbie)
by AL88
How can I make the function return to the for loop
 
Can somebody show me how I can make the function randomNumber quit by pressing the 2 key instead of having to use ctrl+z? thanks. #include <ctime> #inc...
[2 replies] Last: C++ has bool type built-in. You don't need to use an enum. But anyway... (by Ganado)
getline help
 
Hello all, My issue is when I run this code in VS code #include <iostream> #include <fstream> using namespace std; int main() { ifstream fin; fi...
[3 replies] Last: I think it's likely that your input file was created on an Operating S... (by dhayden)
Converting library class into template library class
 
Hi I have been developing a library which has the following structure (simplified for the purposes of the explanation): // myLibrary.h #include "HelperCla...
[1 reply] : It's not unusual to have a header only library in C++. For example: h... (by kbw)
Custom class type for queue?
 
I have the following circular queue code: #include<iostream> using namespace std; class Queue { public: // Initialize front and rear int ...
[4 replies] Last: line 77: 'else' not 'Else' (by againtry)
by StMick
Iterating Over a Vector of Objects
 
Greetings all, I have a question regarding iterating over a vector that holds objects. For some reason, the code within the for loop is not printing to the con...
[3 replies] Last: Reallocation invalidates iterators. See http://www.cplusplus.com/refer... (by keskiverto)
An array of chars (1,2,3)
 
Hi, so I have a task that I have to read from the console and array of chars with maximal length 1 MB, the array of chars can be on several lines. So idea is th...
[49 replies] Last: It's goo goo againtry! Move out of mommy's basement, loser! (by dutch)
Forward signatures of the function
 
Hi all, Is there a way to find the forward signatures of the function in the project package in visual studio? or by any means? Thank you
[3 replies] Last: usually. there may be more than 1 header file, but take a look and se... (by jonnin)
by Cakes
printing arrays with a void fuction
 
I'm supposed to input values into an class array but the loop is in the function call. this is what I'm currently doing. void bookType::setBookInfo(stri...
[2 replies] Last: > title: printing arrays guessing cout > description: I'm supposed ... (by ne555)
Convert from std:string to SQLCHAR *
 
Hi. I am looking for the correct conversion to SQLCHAR* I am given several parameters as std:string. With this parameters I am glueing a correct conStatem...
[9 replies] Last: 10 years misses 2 major revisions to the language; c++11 and c++17 fea... (by jonnin)
Regarding IF condition
 
Hi all, Is there a way of writing the below python code with lesser lines in cpp. if n == 6: var1 if x == 2 else var2, var3 if x == 3 else var4 ...
[4 replies] Last: Thank you so much for your response. No I am not returning the variabl... (by Shruthi LS)
by F95
Getting errors trying to build a Red-black tree with pointers
 
I'm trying to construct a RedBlack tree from a .csv file. It constructs a tree map to map from a string (name from file) to int (numerical value from file assoc...
[15 replies] Last: Yes, after reevaluating the requirements and debugging I now have the ... (by F95)
returning a pointer
 
Have one question and one issue: The question- I have to write a function of type pointer to char that returns a pointer when it finds a match. (This is th...
[5 replies] Last: so its ready to go. Unfortunately Ms Horstmann required a nullptr :)... (by againtry)
Find and replace characters in file
 
I'm writing a program which finds and replaces characters in an input file, and print the file content in an output file. I'm able to write the program using st...
[10 replies] Last: I got it. Thanks all. Do appreciate you guys' help! (by Simon90)
Pointer
 
Write your question here. Hello. Using pointers to a variable is faster than accessing a variable directly. As I understand it, when accessing a variable direc...
[6 replies] Last: Thank you very much! The level of optimization affects the direction o... (by jonnin)
by TunaT
for function
 
want to summarize all the test and test i have to use "for" or "while" but i thought that for would be easier. unfortunately i got stuck. the test and t...
[3 replies] Last: こんにちは, You are welcome. It is the little things that cause ... (by Handy Andy)
Generating next binary bit from given binary string
 
I've got this assignment: First line is the number of test (t) Following lines are the binary strings (a) Print out the result each on individual line The condi...
[2 replies] Last: Thank you I changed the while condition because for some reason it onl... (by longdoan1511)
pointlist in cpp
 
Hi all, How to write the below python pointlist to cpp? ptlist = [[0,3],[1,7],[2,4],[4,6],[7,8]] Thank you, Shruthi
[4 replies] Last: Tank you so much @coder777 , @zapshe (by Shruthi LS)
August 2020 Pages: 1... 45678
  Archived months: [jul2020] [sep2020]

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