General C++ Programming - October 2018 (Page 7)

pointers factorial
 
hi guys, I am using the GMP library to try and make a factorial that deals with very large results, I am not finished yet,but hopefully close the problem ...
[9 replies] Last: The following makes a char array of size 1 initialized with the value ... (by tpb)
Need Help with GCD Program
 
Write a program (with well written comments and explanations) to implement the extended Euclidean algorithm on page 70 (also lecture slides). The program prompt...
[2 replies] Last: c++ already contains the gcd algorithm, you can just call it (does the... (by jonnin)
Receiving strings in C++ from Python (JSON)
 
I'm trying to send boolean values through sockets from Client(Python) to Server(C++). So I have used json and converted the boolean values to string format a...
[2 replies] Last: Thanks Repeater for the reply. Regarding your question, Yes, I'm send... (by Graindor)
Use of templates in external libraries
 
It appears there is a gap in my understanding of templates in C++. I have a recent post where the use of my own template in an external dll caused linking erro...
[12 replies] Last: Correct. Template classes should all be in the header. As we've alre... (by MikeyBoy)
by volang
Sockets/Server security
 
Hey. Hope you are feeling well. I've been playing around with sockets for a while now. It's starting to feel good, but how can I take it to the next level n...
[3 replies] Last: Great stuff here, thanks. (by mbozzi)
Which is better ?
 
Let's say I have a Game class which has gameloop function. What I want to ask is it better to disable gameloop function and copy paste the context to the m...
[3 replies] Last: Thanks, @jonnin I usually close this topic after a great answer like t... (by closed account DEhqDjzh)
PROCESSING A LINKED LIST RECURSIVELY
 
C++ Project 4 DESCRIPTION Design, implement, test, and document a C++ program that reads an input file of text and builds a concordance of the words in th...
[2 replies] Last: Use a for loop to iterate over a list. It makes the code much easier... (by dhayden)
GMP using big numbers
 
Hi guys, so I came across a problem,the problem is quite common.When getting the factorial of a number such as 50 or a 100 even a unsigned long long will not...
[5 replies] Last: thanks Jonnin, that makes sense,so is there any compiler flags I can ... (by adam2016)
What are some recursive algorithms everyone should know
 
For example Binary search, a recursive algorithm that most programmers know, what are some other examples?
[5 replies] Last: filesystem traversal fractals (by lastchance)
by JM567
Opening file using user input
 
Hello! I am writing a code for a checkers game and I need to give the user the option to either start a new game, or continue their saved game. We have two text...
[11 replies] Last: Thank-you for posting your entire code. Now we can see that the locat... (by doug4)
fill buffer (1,2)
 
i have this code but i don t understand why my code crashhh #include <vector> #include <string> #include <inttypes.h> #include <cstring> #include<iostream> #i...
[20 replies] Last: I would add some logging to see the flow of the program and the values... (by Thomas1965)
OpenWatcom and getline()
 
Hi. I'm completely new to C++, and due to my job, I need to start learning it. I decided to use OpenWatcom under Windows 10 (if there is a better lightweight a...
[3 replies] Last: Thank you for your suggestions. We end up giving a try to Dev-C++. (by JpCoder)
C++ Socket Programming sending structure
 
Hi there!! I was trying to send a structure through sockets and I was having these problems: 1. I was passing an int value of 5 but when it went to the server ...
[3 replies] Last: The simpliest way to transmit the data is string using stringstream. S... (by coder777)
by les818
Do while Loop
 
I am needing help creating a do while loop where the first thing is to create a customer number that increases with each loop. const int NAME_SIZE = 20; con...
[2 replies] Last: If you only want to do a do while Loop, it can look like this: do { ... (by LajosOnly)
by ad5xj
Dereference operator
 
This sounds like a newbie question but I need to ask. Can you explain the difference between: foo* bar; foo * bar; foo *bar; Is there any difference ...
[7 replies] Last: ...perhaps. But perhaps the question doesn’t have anything to do wi... (by Duthomhas)
by stav
Explanation of opengl32.dll ?
 
Hi, i just tried to compile my opengl program by linking with glfw and glew but it gave me an undefined reference error for my call to glClear . After a ...
[1 reply] : Haven't used it in a while but I remember having to add 4 or so .lib f... (by jonnin)
Alternative for getline()
 
Hi I'm curious to see if someone can give me an idea for an alternative to getline() for reading files. The .txt file looks like this: A: IoT device A...
[7 replies] Last: thanks all, I got it work as I wanted :) (by parallx)
it keeps telling me to declare val but idk what im missing
 
#include <iostream> #include <ctime> #include <cstdlib> #include <valarray> using namespace std; int main() { val seed=let val m=Date.minute(Dat...
[1 reply] : I don't know what this is: val seed=let val m=Date.minute(Date.fromT... (by helios)
Reusing a deque
 
In a long running program I want to fill a queue with millions of data points periodically. Data points slowly drain but will I have memory fragmentation or hav...
[1 reply] : std::deque<> allocates memory in chunks: As opposed to std::vector,... (by JLBorges)
Error linking when inheriting generic/template class
 
I am writing a object management library that is meant to service objects in different libraries with different string coding classes so that they can interface...
[16 replies] Last: A static data member needs to be explicitly instantiated. The whole p... (by MikeyBoy)
October 2018 Pages: 1... 5678910
  Archived months: [sep2018] [nov2018]

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