Beginners - January 2020 (Page 10)

Failure on Input Response
 
I am adding some quality checks to the sample program for a simple calculator example. The check for divide by zero was included. I added a check for a proper...
[16 replies] Last: Andy - I am still trying to assimilate all the information in your lon... (by SJSwanson)
using c++17+ <filesystem>
 
in this program it simply gets it's own containing directory and adds a data folder if there isn't one already. isn't there an easier way like directly conc...
[5 replies] Last: wow, that was fast. Thanks guys. (by ForeverNewbie)
No of elements wich will passed by *argv[] in main()
 
I read at https://en.cppreference.com/w/cpp/language/main_function that argv should hold argc+1 pointers, whereby the last should be '\0'. So I made the short...
[3 replies] Last: false == '\0' == 0 == NULL and I think also == NULLPTR but not sure. ... (by jonnin)
Basic Recursion- Hints requested
 
Problem Statement: I am trying to wrap my head around recursion, and I'm slowly getting a handle on it, but I keep running into brick walls with it. My curren...
[6 replies] Last: It should also be pointed out that it is pointless for this function t... (by dutch)
C++ Sorting algorithm error
 
Hi, Hoping someone can point out the error of my ways. Im doing an assignment in class where we have to create a c++ program that uses a sorting algorithm to s...
[14 replies] Last: system recognised iti as Data.csv.csv Looks like a Windows "problem,... (by George P)
by Tom001
Guide about how to read a txt from a class
 
Hello! I'm trying to define a class call matrix who reads a txt with the data but I'm having problems with the lecture part. I'm posting the code that I have wr...
[2 replies] Last: A couple of problems, first I don't recommend having the class open th... (by jlb)
Need C++ Compiler for Windows
 
Hello, i did my first Steps with C++ on Linux and used g++ for compilation and linking. Now i want to compile same of my first projects on Windows. Can you p...
[11 replies] Last: Visual Studio (Visual Studio Code is a different thing) can compile C+... (by George P)
Loging
 
Hello members, I have a question is there a possibility to log the input and output from a Roman numeral conversion tool? So that all the conversions automatic...
[4 replies] Last: would a console.log(whatever) in the .js file do it? the reason we ar... (by jonnin)
by Bopaki
My function : void print() does not print out the list
 
Everything look fine but the last part which should print the list does not #include<iostream> #include<cassert> using namespace std ; template<clas...
[2 replies] Last: Thanks coder777 it worked like a bomb. I just wonder how come some peo... (by Bopaki)
help i dont understand the question
 
Please tell me what does this question want QUESTION: Change these expressions inform of compound statements (assume a and b have been declared and initial...
[5 replies] Last: It is asking for an explanation of compound statement: b = ++a * 5; ... (by eyssant)
Lamda func how to return array
 
lamda newb here let's say i want to return the array (of ints) {0,4,9} with a lamda func how it be done i have tried: {0,4,9} {return {0,4,9}} i wan...
[3 replies] Last: > let's say i want to return the array (of ints) {0,4,9} with a lamda ... (by JLBorges)
Foo() vs. Foo{}
 
Hello, I have two questions: 1. What is the difference between Foo() and Foo{} here: struct Foo { // ... Nothing }; int main() { throw...
[3 replies] Last: I think this covers the topic: https://en.cppreference.com/w/cpp/langu... (by keskiverto)
Heap Corruption
 
Hi! I have written a binary search function which finds the last occurrence of a number in an array. When I test it, it always seems to give the correct output....
[3 replies] Last: @salem I had tried that earlier too, but then I wasn't getting the cor... (by stoneJax)
by jhon12
how add class
 
hello I want to ask ... the program below is the presidential election program and the program is ready. I want to ask how to add classes to the program? please...
[7 replies] Last: nuderobmonkey's code compiles for me. I don't see anything particularl... (by Ganado)
Computer guesses the number
 
Hello, Well my teacher gave us an assignment and I have to do it by only while, for, if-else loop. I cannot even use do loop. Also we can't use "Rand" command ...
[12 replies] Last: 26 the size is 100, so lg(100)+1 is the max # of tries. or, 7 max gu... (by jonnin)
by Majeek
cout name of vector in a vector (2D Vector)
 
My goal is like this: std::cout << Colors << " " << Colors ; Which would output : Red 0. How would I achieve this?? Or am I thinking about it all wrong ...
[2 replies] Last: The variable you call "Colors" is your deck, right? I assume that at s... (by Ganado)
Sort records in struct
 
Hello!I need to sort students by name and by age. But I just can't figure out how to do it. Basically I need a function like chkinfo() to list all records but s...
[3 replies] Last: student s; //...fill s stud.push_back( s ); (by nuderobmonkey)
inability to read line, more than a specific one!!
 
Dear I have a piece of code. It reads input files (Data.txt, Index_list.txt, and Nb_list.txt) and gives output file (NB.txt). Index_list.txt, and Nb_list.txt f...
[1 reply] : Don't cross-post. http://www.cplusplus.com/forum/general/267017/ (by salem c)
by hbcpp
Binary Search Tree With Templates
 
I have written a working binary search tree, then I went on to change it so that it working with different types. All is well excep for one line that stops the ...
[5 replies] Last: @lastchance Thanks it works. (by hbcpp)
Strcpy not being recognized - 'not declared'
 
Hello, I am trying to execute the following requirement. Note I try to use 'strcpy' but I am getting an error. I am not sure if this could be a problem with my ...
[3 replies] Last: In C (and in C++ as well as an alternative), it's in the header file ... (by Repeater)
January 2020 Pages: 1... 89101112
  Archived months: [dec2019] [feb2020]

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