
please wait
by bydrachen
Questions about C++ strings...
|
Hey, thanks for coming here. Currently I'm learning C++ and beyond. While I'm using C++ strings and come up with some inconsistencies. Do we really need incl... |
Mar 31, 2022 at 7:35pm
[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, but I've already gotten stuck again, I need to know if its ... |
Mar 31, 2022 at 6:10pm
[3 replies] Last: that aside, this is a major POINT of structs/objects, is the ability t... (by jonnin)
|
by Ceddy D
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. } int main() { int i; Func(i); //more calculation... |
Mar 31, 2022 at 3:27pm
[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<<"Enter size of the array :"; cin>>n; cout<<"Enter el... |
Mar 31, 2022 at 1:20pm
[19 replies] Last: [quote=Paul5]So the time complexity of the program you mentioned above... (by lastchance)
|
by HellocMonkey
String Manipulation
|
hello I have been trying to get parts of this code to work. I had it compling before but not anymore(i think bracket problem). Mainly Ive been trying to get ... |
Mar 31, 2022 at 12:28am
[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 machine, but I just tried using cin and im getting an error tha... |
Mar 30, 2022 at 8:17pm
[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 generator 100-1000. I need to Generate a random number between 1... |
Mar 30, 2022 at 11:21am
[8 replies] Last: Using C++ random - rather than C rand()/srand(), then: #include <ra... (by seeplus)
|
by loopmonster
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 for both the max and min. #include <iostream> #include ... |
Mar 30, 2022 at 9:33am
[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 append it to the result. 2Pick the smallest integer from which... |
Mar 30, 2022 at 5:46am
[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 you can press enter to continue and stuff that makes the pr... |
Mar 29, 2022 at 10:11pm
[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 append it to the result. 2Pick the smallest integer from which... |
Mar 29, 2022 at 4:23pm
[3 replies] Last: [new thread at http://www.cplusplus.com/forum/beginner/282916/ ] (by seeplus)
|
by Adalaide
Nesting Loops Explaination?
|
I finally understand the basics of the for loop but I am really having a hard time grasping the concept of how and when to use a nested loop. Is there anyway so... |
Mar 29, 2022 at 1:58am
[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. Each tile can rotate (ie the first number becomes the secon... |
Mar 29, 2022 at 1:34am
[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? -------------------------------------------------------------... |
Mar 28, 2022 at 9:36pm
[2 replies] Last: #include <iostream> #include <vector> #include <set> #include <algori... (by lastchance)
|
by jzilliam
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 The file is called options.txt and contains: 5000 Leather S... |
Mar 28, 2022 at 5:15pm
[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 that i<j and Ai>Aj . Please count number of inversion pairs i... |
Mar 28, 2022 at 2:42pm
[5 replies] Last: Adding a condition is tiny, agreed. I would think that skipping the l... (by jonnin)
|
by Happilicious
Solving data alignment issue
|
I have function A that only spits out arbitrary amount of byte (on range of 0x10 to 0x80), and function B that allows me to pass data only in 0x100 byte. Th... |
Mar 28, 2022 at 11:34am
[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,2,...n. You want to know whether you can rearrange the c... |
Mar 27, 2022 at 10:40am
[20 replies] Last: oh yes, there's no warning message, I'll try using the debugger, thank... (by Pen72)
|
by Adalaide
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 some issues with this code. I am trying to write a code that ... |
Mar 27, 2022 at 9:45am
[3 replies] Last: Valid - if input < 6 digits and inputLength <= 8 ?? Seems a queer vali... (by seeplus)
|
by jaffe15
Do .tcc/.tpp files need headerguards?
|
If I understood correctly .tcc/.tpp files should have their includes in the correspnding .h file and aren't included more than once. So I am guessing that they ... |
Mar 26, 2022 at 12:14pm
[1 reply] : That's right. You only need to use header guards for the header files. (by Peter87)
|