General C++ Programming - November 2019 (Page 5)

segfault at swap()
 
At line 38 I get a segfault. But I think that I don't access beyond some memory section. #include <algorithm> #include <iostream> template <typename Ite...
[2 replies] Last: The error was, that the strings got protected within the execution bin... (by nuderobmonkey)
Basic Input/Output Tutorial
 
The Basic Input/Output Tutorial found here: http://www.cplusplus.com/doc/tutorial/basic_io/ contains this: --------------- cin >> a; cin >> b; ...
[3 replies] Last: Whitespace isn't always needed. #include <iostream> #include <sstrea... (by lastchance)
by Mintu
What is the best way, in your opinion, to learn C++ from nothing?
 
I know almost nothing about programming, even having taken a high school course in Java a year ago (straight from a workbook that was way too advanced and had n...
[2 replies] Last: Too many of the video tutorials are horrible. Very outdated and wrong... (by deleted account xyzzy)
cin.getline(variable, 100) was skipped
 
Hi. I hope someone can help me. I've done make some research on google and I still not found how to resolve my problem. The thing that I was did : - use cin....
[10 replies] Last: @DARKADVERSARY, One change I would make, after adding std::cin::igno... (by deleted account xyzzy)
Getting information from the internet
 
Hello guys. I am a beginner in c++. Yet, I have an assignment to make a chatbot that replies to questions regarding c++. I built a chatbot that had hardtyped ke...
[4 replies] Last: https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1... (by deleted account xyzzy)
how can i test how many dimensions have the array?
 
seen these array: int data ; we know that array have 4 Dimensions... can we calculate how many dimensions 1 array have it?
[15 replies] Last: i can test if the variable is an array Yet another link: https://en.... (by Enoizat)
How to put a string in a WHILE loop
 
How do I put a string in a WHILE loop. I'm practising, and I decided to try and make a register. string firstName; string lastName; cout << "Enter name ...
[1 reply] : I have a guess of what you're going for, but I think it would be bette... (by Ganado)
Replacing "+" with "=" when calculating sum of all digits
 
Hey everyone. I wrote this code in order to successfully determine all the digits of a number as well as the sum. However, here is the output of the code: 2+...
[3 replies] Last: Print the '+' with the digit that comes after it, not the one that com... (by dhayden)
by malugu
STM8S103F3P6 TIM1_CH3 capture problem
 
I am using the STM8S103F3P6(Product details: https://www.electronic-components.hk/product-detail/0b7/STM8S103F3P6.html) internal 8M crystal, step 1hz~1KHz frequ...
[2 replies] Last: Ive seen robot generated code that was better written. This is straig... (by jonnin)
How to interpret the question?
 
How do I interpret the following practice problem: (I have done the problem and finished it but I can't tell if I have finished it) [from a 'popular' book] "3...
[1 reply] : I would suggest that you remove 18 completely and pass the pointer dir... (by coder777)
Using Recursion to List all Prime numbers from 1 to n
 
Hello everyone. I am struggling to use recursion in order to list all the prime numbers from 1 through the inputted variable. If anyone can help me out, I would...
[1 reply] : #include <iostream> using namespace std; void recursion( int n ) { ... (by lastchance)
How to specify more than one field as a variadic template function?
 
The following code: template <class C, class D> std::vector<Model::Category> getCategoriesSortedBy( D C::* field) { using namespace sqlite_orm; usin...
[3 replies] Last: template<typename ...Ts> std::vector<Model::Category> getCategoriesSor... (by JUANDENT)
strange error at std::cout
 
I tried to implement a partitioning algorithm for later using at quicksort, but when I try to compile, I get a long list of errors (several pages long). #...
[9 replies] Last: The compiler only considers the function signature. Even though a cal... (by Ganado)
Programming and deployment in Server
 
We have a Server where all our programmers develop in the same environment and deploy. This means a single point of failure. How can we use a second server t...
[2 replies] Last: What does "software services" mean? If you have virtual machine(s) an... (by keskiverto)
No errors, but program execution not working at all
 
Hey, I feel like the solution to my problem is simple, but I've spent hours trying to find it and I think a new pair of eyes would help. I posted my client file...
[4 replies] Last: += doesn't need to call simplify() because operator+ already did. oper... (by dhayden)
Can someone explain this pseudocode
 
It was one programming question for a telecom entry-level new grad job. I am just wondering if the variables define a pattern of something. if x < y swap (x,y)...
[10 replies] Last: Ah, C++17, and in <numeric> . https://en.cppreference.com/w/cpp/nume... (by deleted account xyzzy)
switch-case being most efficient
 
In C++, how do I code switch-case the most efficiently by making use of the fittest alignment?
[4 replies] Last: I was quoting a post before mine, that has since vanished. I guess the... (by mbozzi)
Getline not working
 
hey everyone when I use getline with strings, it doesn't work. In my code, I am creating a string array called crew. The user inputs the number of strings in ...
[6 replies] Last: The actual newline sequence depends on your OS/compiler. For Windows, ... (by Duthomhas)
by chr0w
Class object overwritten
 
Greetings I have an issue where I've made a simple point class. When i instantiate two different objects of the same class, somehow, the first instance is ov...
[3 replies] Last: Good. Note: Your constructor assigns values after initialization.... (by keskiverto)
multiple heritage between classes and imbiguity
 
I have a class Personne which has two inheritors : Enseignant an Etudiant, another class EleveVacataire inherits these two classes. meanwile i have a method nom...
[2 replies] Last: Yes it worked thank you so much. (by MarouaneM)
November 2019 Pages: 1... 345678
  Archived months: [oct2019] [dec2019]

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