General C++ Programming - December 2019 (Page 7)

Stacks (1,2)
 
#ifndef DYNINTSTACK_H #define DYNINTSTACK_H template <class T> class DynIntStack { private: // Structure for stack nodes struct StackNode { T value...
[29 replies] Last: The 'reverse' means that it will be bottom -> top (by CodingIsHard17)
Mechanism in a function argument alias for any type
 
How to do mechanism for a function argument alias for any type, as such in pointer to void argument is for any type ?
[1 reply] : Use function templates, unless you have a really good reason not to. ... (by Ganado)
Reading line by line
 
I know how to read a .txt file line by line using ifstream, but I need a specific action this time. Let's this be my input file: 1 2 1 2 3 4 5 1 2 3 4 5 1 2 3...
[5 replies] Last: #include <iostream> #include <fstream> #include <sstream> #include <v... (by lastchance)
by volang
Handle TCP protocol on your own
 
Is it possible to somehow dive deeper, and handle the initial TCP handshake(SYN/ACK) on your own? At the moment winsock is doing this for me.
[9 replies] Last: If you want to watch the wire. One of these (or the pre-assembled one... (by salem c)
Determining argument is given or omitted by compiler
 
how to determine / check whether argument is given or omitted in compile time? bool a_function(char* b, size_t len=0) { // no run time check such as if ...
[1 reply] : The parameter is not 'omitted' in that sense that the function can det... (by coder777)
Rotate Left and Right
 
May someone please help me with this code. The task is really simple i guess. The call rotateRight function must move all the elements in the array with one po...
[6 replies] Last: The inputs are number arrays and char arrays, you have to use templat... (by againtry)
Read from a text file and then write into a binary file
 
CAN NOT USE VECTORS In this program I have to read a text file and write into a binary file. when writing into the binary file, the number of Persons should ...
[7 replies] Last: Change line 68 cin.ignore(); to inFile.ignore(100... (by lastchance)
by Dee5
Division by zero problem
 
Hello guys..I'm working on a program which determine if numbers divided have remainders or not. If they have remainders it prints out "Arcanum!" If they don't ...
[2 replies] Last: Thanks (by Dee5)
there is a questions about c++.
 
int main(int argc, char** argv) { int cart1,cart2,cart3,cart4,cartotal,x; string players ; { srand(time(NULL)); string lpayers = { "A player"...
[2 replies] Last: for example; start program. Then choose "A player". I give card1 and c... (by o1m2e3r4)
by Dee5
Finding the hidden numbers (1,2)
 
Hello guys,I'm kinda new in c++ and Im having a little problem. I'm trying to make a program which will count the occurrence of numbers less than 1000 in a list...
[25 replies] Last: Sorry again, so what if I want the user to input the number of items h... (by Dee5)
Student Binary Files
 
#include<iostream> #include<fstream> #include<cstdio> using namespace std; class Student { int admno; char name ; public: void setData...
[6 replies] Last: If you use an object in Student, say std::string instead of char arra... (by kbw)
Why error: ambiguating new declaration of 'std::string& strs(std::string&, const char*)'
 
Got this error: ambiguating new declaration of 'std::string& strs(std::string&, const char*)' though the declaration is bit different in types prototype, ie. o...
[1 reply] : > ie. only in returned value type the return type is not part of the s... (by ne555)
by jebek9
game sorry
 
#include <iostream> #include <cmath> #include <cstdlib> #include <time.h> using namespace std; int randomNumber() { srand (time(NULL)); return rand...
[1 reply] : bool win = false; int winner; while (!win) { for (i... (by Repeater)
How to fix these error for radio sort algorithm?
 
There are two errors on this header file: Line 22: expression did not evaluate to a constant. Line 33: array type int is not assignable. radixSort.h ...
[9 replies] Last: I am not going to rewrite your whole program for you 3 times over. yo... (by jonnin)
by volang
Load/edit/update functions from dll.
 
I want to export a function, from a .dll file in to my C++ program. I read that I have to load the entire file/library in to memory, then I can retreive the add...
[7 replies] Last: So if I unload the library, the address to the function that i've got... (by helios)
Greedy algorithm
 
Hi! Here's a problem about greedy algorithm. The statement is below : Suppose we have a set S = {a1, a2,...,an} of n proposed activities that wish to use a re...
[1 reply] : yes, you can do it that way. it just changes the solution accordingly.... (by jonnin)
by exro
Converting an integer in an array to an integer
 
Hi, so I am trying to create a program where I can give it arguments from a batch file, which contains an x and y coordinates that will change the console curso...
[4 replies] Last: At risk of sounding like a broken record - this is why you should alwa... (by MikeyBoy)
The C++ ABI
 
Rob and Jason are joined by Titus Winters from Google. They first discuss some news of C++ tools, including Sourcetrail going open source and C++ Build Insights...
[no replies]
by doug4
Typedefs in Derived Classes
 
I am working on a code generation tool with which I can generate Data classes and associated Manipulator classes specific to each Data class. As part of the ge...
[4 replies] Last: @JRBorges, Thank-you. I think I understand now. Nice explanation. (by doug4)
by Dee5
Counting next numbers
 
Guys I need help...this code only counts the first input from the user and leaves the other following number. Can you help me to make it read and count the nex...
[1 reply] : This seems related to / doublepost of: http://www.cplusplus.com/forum/... (by keskiverto)
December 2019 Pages: 1... 5678910
  Archived months: [nov2019] [jan2020]

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