Beginners - May 2019 (Page 7)

Sorting an array of structures with a pointer
 
Hi, I have a pointer to an array of structures in a DLL that I need to sort. I have searched the Internet but I can’t find an example that reflects what I am...
[6 replies] Last: Note that the other form of sort that anup30 did use: std::sort( ar... (by keskiverto)
Inheritance of Specialized Class from Non Template Class and Template Class from Specialized Class
 
I have two questions which I am unable to solve myself. Questions are, - Is it possible to inherit Specialized Class from Non Template Class? - Is it pos...
[1 reply] : I think that the answer to both questions is 'yes'. See https://en.cpp... (by keskiverto)
Problem tracing -Code Output
 
Dear C++ Community I do not seem to understand, the following code`s output even after tracing it. void f(int* &c, int* d){ *c =16; c = c+2; ...
[4 replies] Last: Rather than get lost in alphabet soup, rename variables to be somethin... (by salem c)
by Hezyln
My final value is not consistent.
 
My final value is not consistent.
[2 replies] Last: Hello Hezyln, PLEASE ALWAYS USE CODE TAGS (the <> formatting button... (by Handy Andy)
by dumguy
Need help with int pointer conversion
 
Hello all I'm just starting with cpp for arduino/freeRTOS. I created a simple program whic creates task to blink three LEDs are on pin 13,12 and 11. To Debu...
[5 replies] Last: Oh, it's probably best to ignore my post. I should have read the OP m... (by mbozzi)
search an array of strings
 
how would i create a function that searches a data from an array of strings?
[4 replies] Last: my initial post got reported too... so i dont know (by gongong)
issue with classes and vectors!
 
I've been trying to make a program, using classes and vectors, and I keep running into this error, or I guess, errors. "Severity Code Description Project Fil...
[3 replies] Last: figured it out! (kinda) Basically, something about my PersonalLibr... (by AshleyHideo1917)
Fill struct array from text file
 
Hi, I need to create a struct array, pass by reference into a function, and the fill the array through a text file in this function. My array has five column...
[5 replies] Last: >"Is there a way to read one line at a time?" yes. use getline() #inc... (by anup30)
by cc046
dynamic programming
 
PROBLEM: You are provided with a set A. A good range is the largest range of elements that contain only one element from the set A. you are also a range of...
[8 replies] Last: thanks Duthomhas I got 100 points.. Thanks Again (by cc046)
Adding to file name using a (string)variable + "test.txt)
 
username is a user input and I wanna name a file as username_friends.txt I used this line of code string fileName= username + "_friends.txt"; So I can then o...
[5 replies] Last: Damn I didnt expect such fast answers, thank you for your time (and pa... (by closed account 17Mo1hU5)
How to remove data from the file i made?
 
I need to remove specific data from the file #include <iostream> #include <fstream> #include <string> using namespace std; struct Teacher { st...
[5 replies] Last: excuse me i plan to use array as to keep track of all those teachers ... (by CoolAvocado)
by Pecvx
std::map and operator<
 
If you make a map<key,value>. Is it necessary for the key datatype to have the operator< defined? Given that a std::map is sorted on keys.
[1 reply] : If the key is not LessThanComparable (or if we want a different crit... (by JLBorges)
Print repeating diagonal in array
 
Hi, I'm trying to print a repeating pattern of numbers, going from 1 to 5, in the diagonal of a 20 x 20 array, but my code isn't producing anything. What am ...
[1 reply] : Use “modular arithmetic”. The idea is that you have a remainder. ... (by Duthomhas)
Memory management
 
Hello, I have a theoretical question about programs memory. When I'm about o run a program, the Operating system saves memory for it to work. But, this amoun...
[1 reply] : Well the OS doesn't know in advance what a program is going to need. ... (by salem c)
Printing array using pointer logic
 
Hello, I was trying to print an array of integers using pointer logic to it. So, as an integer uses 4bytes of memory, for me to jump from cell to cell of t...
[2 replies] Last: Got it! Thanks! (by Lucas Fiorini)
Copy constructor and assignment operator invoked at same time
 
Dear C++ Community I found an interesting question in my test about describing a circumstance in which a copy constructor and an assignment operator for a clas...
[1 reply] : I am right in assume they want a real-life example? As real-life ... (by mbozzi)
Copy constructor invoked question
 
Dear C++ Community I encountered a question, if the following program fragment was run the copy constructor for the class X would be invoked three times. ...
[1 reply] : - The copy constructor would not be invoked on line 7. By definitio... (by mbozzi)
by ICantC
finding items in generic list
 
I have a template list class of template nodes and I'm trying to put all the functionality in a separate iterator class (for learning) - but the below is gettin...
[5 replies] Last: iter = std::make_shared<node<T>>() = list.head; ¿what? ¿why there ... (by ne555)
PPP chapter 16 exercise 4 - read access violation.
 
I'm currently trying to complete exercise 4 in Stroustrup's Programming Principles and Practice, which have you create a window class able to create a button, w...
[4 replies] Last: gdb is a debugger, a wonderful tool used to fix runtime and logic err... (by grumblesnake)
Combination
 
hello everyone i'm trying to make a combination of characters in c++ it goes something like that: a b aa ab ba bb aaa aab aba abb baa bab bba bb...
[5 replies] Last: Using GMP (the snippet runs a small finite loop, starting with a spec... (by JLBorges)
May 2019 Pages: 1... 56789... 16
  Archived months: [apr2019] [jun2019]

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