Beginners - March 2022

by Slyde
const pointer
 
I'm trying to get a grasp on const pointer. Given the following code: const int num1{100}; ...
[3 replies] Last: Nicely explained. I appreciate your time, seeplus. Thanks again. (by Slyde)
Questions about C++ strings...
 
Hey, thanks for coming here. Currently I'm learning C++ and beyond. While I'm using C++ strings and ...
[6 replies] Last: Really thank you, guys. I learned that c++ header files are not having... (by bydrachen)
Matching one part of a struct with another
 
follow-up to https://www.cplusplus.com/forum/beginner/282933/ Thanks for your help on my last post,...
[3 replies] Last: that aside, this is a major POINT of structs/objects, is the ability t... (by jonnin)
Is it better to declare global variable or declare variable multiple times?
 
So I got some code, it looks a little like this... void Func(int i) { //calculations with i. ...
[4 replies] Last: Objects offer a way to control globals and limit access if you must us... (by jonnin)
by Paul5
C++ program to sort even nums in descending order then odd nums in same order using one array and without built in functions
 
#include<iostream> using namepsace std; int main() { int a ,i,n,j,k,temp,c=0; cout<<"...
[19 replies] Last: [quote=Paul5]So the time complexity of the program you mentioned above... (by lastchance)
String Manipulation
 
hello I have been trying to get parts of this code to work. I had it compling before but not anym...
[6 replies] Last: im using dev c++ version 5.11 update: i think i got it figured out no... (by HellocMonkey)
using cin with structs
 
I'm trying to create a digital vending machine using structs for all of the Items in the vending mac...
[3 replies] Last: you can overload the << and >> operators for cin and cout making them ... (by jonnin)
by Squabs
Writing Functions for Number guessing game
 
Trying to finish an assignment and need some assistance. Trying to write functions for a number gene...
[8 replies] Last: Using C++ random - rather than C rand()/srand(), then: #include <ra... (by seeplus)
Min and Max Value in Array
 
I am trying to find the minimum and maximum value from my text file array but the output is always 0...
[3 replies] Last: This program can be simplified. #include <iostream> #include <fst... (by seeplus)
by Pen72
No output
 
The way to swing the list follows the algorithm below : 1Pick the smallest integer from s and app...
[4 replies] Last: Using the iterator on line 45 is illegal due to the erase on line 44. ... (by coder777)
Why is system() hated so much?
 
Why do people say using system() is bad coding? I like using it to create "breaks" in my programs so...
[5 replies] Last: To help explain @kigar64451's comment, the black terminal screen you s... (by mbozzi)
by Pen72
Using Multiset
 
The way to swing the list follows the algorithm below : 1Pick the smallest integer from s and app...
[3 replies] Last: [new thread at http://www.cplusplus.com/forum/beginner/282916/ ] (by seeplus)
Nesting Loops Explaination?
 
I finally understand the basics of the for loop but I am really having a hard time grasping the conc...
[1 reply] : Nested loops are often used with 2 dimension arrays such as your theat... (by AbstractionAnon)
by worldd
Dominos problem
 
An integer N is given, followed by N number of pairs of integers - the pairs represent domino tiles....
[6 replies] Last: heh.. adding tiles to the start is changing the starting point, though... (by jonnin)
by Pen72
Sum of numbers
 
Any idea to solve this problem in a more efficient way other than comparing it one after another? -...
[2 replies] Last: #include <iostream> #include <vector> #include <set> #include <algori... (by lastchance)
Reading numbers from a file into an Array/Vector
 
Hi had a question about reading a file with a int and a string and putting it into a vector/array T...
[4 replies] Last: #include <iostream> #include <fstream> #include <string> #include <v... (by seeplus)
by Pen72
Improve time efficiency
 
Given a sequence of distinct integers A . An inversion pair is defined as a pair(Ai,Aj) , such tha...
[5 replies] Last: Adding a condition is tiny, agreed. I would think that skipping the l... (by jonnin)
Solving data alignment issue
 
I have function A that only spits out arbitrary amount of byte (on range of 0x10 to 0x80), and funct...
[4 replies] Last: You are right jonnin. I used memmove at the end and it works well for ... (by Happilicious)
by Pen72
Coach problem (1,2)
 
A train moves from A through a station to B. Initially, the coaches of the train is numbered by 1...
[20 replies] Last: oh yes, there's no warning message, I'll try using the debugger, thank... (by Pen72)
Help with password requirements code.
 
I have been doing wicked good lately thanks to all the help I've been getting here but I am having s...
[3 replies] Last: Valid - if input < 6 digits and inputLength <= 8 ?? Seems a queer vali... (by seeplus)
March 2022 Pages: 123... 7
  Archived months: [feb2022]

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