Beginners - January 2021 (Page 3)

Single-link list
 
help.I need to create a list of paired positive elements of two input lists where is the mistake? #include <iostream> #include <Windows.h> using namespace s...
[4 replies] Last: > where is the mistake? ¿what are the symptoms? ¿compile error? ¿cr... (by ne555)
Return pointer in Main function - C
 
Hello, How can I fix it? I want to back "12" in the main function with the result pointer and then print it. The function is worked fine but I have a problem w...
[3 replies] Last: #include <stdio.h> #include <stdlib.h> void strstrX(const char* num... (by seeplus)
by PK Dey
if (flag)
 
Write your question here. for (i = 0; i < m; ++i) { flag = 1; for (j = 0; j < n; ++j) { if (a2 == a1 ) ...
[7 replies] Last: the reverse it true as well, boolean expressions result in integer 0 ... (by jonnin)
Case Insensitive Palindrome
 
I am making a case insensitive palindrome but it is only working on lower cases letters like racecar and madam but, if you put RaCeCar, it is not working. Any h...
[4 replies] Last: Hello WeebTriestoCode, After I posted and saw seeplys's responce I ... (by Handy Andy)
Avoid copying object in list initialization
 
Hi all, when I run this program, I get the following: New point created. Another point created from copy constructor. Circle created. Is there a way to avoid ...
[5 replies] Last: If you are intending to be able to move that point (for example, in a ... (by lastchance)
Averaging elements of a 2D vector in C++
 
Hello, my code is returning only the last element calculated inside the loops. I am "binning" (resize averaging the neighbors elements) a matrix 4x4 into a 2x...
[2 replies] Last: Hello dutch! it worked perfectly. I also test it with a 1024x1024 .tx... (by DanielDeChamps)
Anagram code not working when I put in on a switch statement
 
Hello there, I am stuck in this code about finding anagrams. I practiced this in a different code and it work. The first code is working but when I use it in a ...
[2 replies] Last: Yo! It works!!! Thanks dude... I am stuck in this problem for almost a... (by WeebTriestoCode)
File handling assignment I can't even start coding
 
I have this assignment due in 3 days. Trust me, I've been trying and trying to code it, but to no avail. So I apologize for not putting any code in here. There ...
[7 replies] Last: you are correct, I missed: n = 0, 1,..., n so yes, its that simple lol... (by jonnin)
how to calculate the speed of a journey
 
i have to intup the time periods(12 55; 18 00 etc) and distance from the console for a few journeys and then i have to output the journey with the greatest spee...
[7 replies] Last: As others have mentioned, you need to convert the hours/minutes values... (by dhayden)
by VoB
Explicit instantiation example for a templated function
 
Hi everyone, when dealing with templated classes/functions, it's common practice to put both declarations and definitions inside the header, rather than writ...
[16 replies] Last: Thanks for the check ! (by VoB)
C++: counting numbers
 
Hi! I have a sub program where I find every prime numbers between 1..10000. Now in driver program I need to count how many prime numbers I found. How should I...
[7 replies] Last: #include <iostream> #include <cmath> #include <valarray> using namesp... (by lastchance)
questions to the Class II of the tutorial.
 
Hi,comrades. I am studing class II here. and I don't know the first ampersand& used in the following code. I mean the ampersand sign between Cvector and Cvec...
[4 replies] Last: > but the link in your post cannot be accessed here. I guess you faile... (by salem c)
class reservation program
 
Im in desperate need of assisstance. I have project to make a class reservation program but i do not know how to add loop in my program. I am still a beginner s...
[5 replies] Last: Hello nurnisa, After working on your program I have concluded that it... (by Handy Andy)
Problem passing int to function
 
I cannot figure out what I'm doing wrong. I want the output to be 79 only without the garbage. int count=79; void setup(){ Serial.begin(57600); } voi...
[2 replies] Last: Yes, it works very well. I tried it on 19200 and garbage there also. D... (by denniscj7)
How do i add loop in this class reservation program?
 
[See http://www.cplusplus.com/forum/beginner/275633/]
[no replies]
by Ulik
I can't find my mistake
 
Run code, you saw the error. Where did I make mistake ? #include<iostream> #include<string> using namespace std; struct now { int day1; int ...
[1 reply] : string ProductList ; This is an array with a run-time defined s... (by seeplus)
.txt to matrix
 
Hello everyone, I made a code to convert .dat to .txt, and after put the .txt created in other 2 matrices (distances_1 and distances_2). The problem is that the...
[16 replies] Last: Yes, that is true. I will get this habit, define functions is very goo... (by DanielDeChamps)
help with my assignment please...
 
So been trying to finish this assignment for weeks now and i only have a couple weeks left before i fail it. everything needs to be done locally. if anyone coul...
[3 replies] Last: For the simple menu starter, consider: #include <iostream> #include... (by seeplus)
stuck in very basic file stream function
 
this is a simple family record program. there is some problem in function void read(). i cant figure it out, when the function gets executed it stucks in infini...
[9 replies] Last: got it corrected show(). file operation was useless in this , i didnt... (by Reddevil1003)
Help me optimize my code
 
Hello this code right now is running in 1,1s with a lot of input (about 3 000 000 000 numbers i think). I don't know how much data I get to the code, because it...
[4 replies] Last: Loop L22-25 isn't needed as the vector can be initialised in it's cons... (by seeplus)
January 2021 Pages: 12345... 11
  Archived months: [dec2020] [feb2021]

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