General C++ Programming - July 2017 (Page 2)

Updated sockets code for C++
 
I've been developing a MUD as way to hone my C++ skills (and because I love to play MUD). As I'm working through the sockets programming portion I notice it's ...
[1 reply] : Boost.Asio: http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio.h... (by mbozzi)
How to Eject USB Printer
 
Is there any way to eject USB printer connected to device programmatically. My aim is to prevent user accessing sensitive data through Pendrive/Mobile/Printing ...
[1 reply] : This is not secure. You need to have the system administrator disable... (by jonnin)
by ztdep
use reference as class member
 
Dear friends: I am confused about the problem of "using reference as class member". For example, i have two classes. class A { public: A(Mesh& FM):FVm...
[3 replies] Last: typedef int Mesh; class A { public: A(Mesh & FM):FVmesh(FM) { ... (by dhayden)
by RezaAb
How to pass values of vectors to 2D matrix or a vector in Eigen
 
Hi all, I am trying to solve a linear equation Ax=b using Eigen's abilities for the A as a square 2D vector. I have the A and b as C++ based 2D vector and 1D ...
[2 replies] Last: I tried the Map class, but I was wondering what should I include in my... (by RezaAb)
Cannot Compare String to String
 
Hi, I am having trouble with my code not being able to compare two strings. One is user entered, and the other is from a structure. My professor likes us to use...
[8 replies] Last: If you are right @dhayden, I guess that could have happened using a ch... (by Chervil)
by mj1709
Segmentation fault custom sort with a struct
 
I am using a custom sort function with a deliberate bug. I want to know why is it failing. Code: https://pastebin.com/d7mrJQtT Test case: https://pastebin.co...
[7 replies] Last: ne555, you're right. I made a mistake. A better example would have be... (by Peter87)
by RezaAb
1D nearest interpolation
 
Dear all, I am trying to find a routine to interpolate a 1D vector based on NEAREST NEIGHBOR. For example, if I have the following vectors, looking for the ...
[7 replies] Last: Thank you all very much, using your suggestions, I improved my functio... (by RezaAb)
by sna3
ifstream file
 
let say i have to call a matrix, say matrix A and then i input it as test1.in file. the i have to call another matrix, say matrix B and input it as test2.in fil...
[10 replies] Last: @chervil Really appreciate your help. I am actually looking at your pr... (by sna3)
by i773
Is it possible to access a function for a running application dll?
 
I am just getting into the deeper parts of creating dll's and I am wondering if it's possible to fire a external function in a dll for a running application? ...
[6 replies] Last: "By the way, it's terribly confusing how you keep using the word "app... (by i773)
Saving Website data into exel
 
Hey guys, sorry for my english but i am looking for a programm to save some website data into an exel file. I was wondering how to write a programm that can...
[2 replies] Last: If the data is rather simple, you can dump to text (CSV style) and pul... (by jonnin)
adaptive simulated annealing
 
is anyone having an idea about adaptive simulated annealing algorithm and how it can be implemented? Thanks
[1 reply] : You could peek how Lester Ingber did it ... (by keskiverto)
Confused about SFML sf::Drawable
 
I have a function in my main class in my Snake Game SnakeGame::getDrawables which returns a std::vector<sf::Drawable*> which contains all of my drawable obj...
[2 replies] Last: Thanks! This worked! (by RUNNER PRO AGARIO)
How to assign array of pointers
 
I have a 2D array: unsigned char** x = nullptr; I first assign the column vector like this: x = new unsigned char* then use a loop to assign the rows l...
[2 replies] Last: > new (unsigned char*) returns ... This is an erroneous construc... (by JLBorges)
Are my std::add_lvalue_reference and std::add_rvalue_reference implementations correct?
 
Hi. I read that the type_traits header file gives two utilities: add_lvalue_reference and add_rvalue_reference I didn't find the official implementation...
[11 replies] Last: > Perhaps something like this Yes! Thanks! A huge improvement on the ... (by JLBorges)
by evdo
the quickest method finding the greatest number in array
 
Hello guys! i would like to learn the quickest method for finding the greatest number (interger) in an array,i know some methods but i want to learn the quickes...
[4 replies] Last: if very large, multi-thread might help. If a true real time program,... (by jonnin)
by Rajpal
Class Shape and issue related to reflcet and translate point
 
Hello I was asked to write an abstract shape class with pure virtual functions and then implement derived class ie rectangle, circle and square . But I am al...
[3 replies] Last: Please post responses in the other thread. (by dhayden)
Book for Numerical Analysis with C++
 
I am looking for a book in Numerical Analysis, with algorithms implemented in C++. Basically, I am looking for the usual stuff: Newton's method, numerical integ...
[4 replies] Last: It is not exactly what I am looking for. To repeat it: ". I would like... (by Claudius7)
by cmisip
Casting a memory address into a pointer type to get the value at address.
 
Why does the following code produce different results for Method 1 and Method 2? /* * To change this license header, choose License Headers in Project Proper...
[9 replies] Last: I just read an article about this. http://antirez.com/news/111 He re... (by cmisip)
Returning a pointer to char
 
I have a class that looks like: class xxxx private: char * firstname ; public: const char* getFirstName(); When constructing the "getFirst...
[4 replies] Last: Here are four different versions (and more variations are possible) Th... (by JLBorges)
by Yany
Problem running a project with FMOD library outside the development environment
 
Hi everybody, I'm using FMOD Low Level Programmer library and API, as an additional inclusion to my MFC project in Visual Studio 2015, for play several sou...
[4 replies] Last: Helios, I found the problem. Sorry, it was my fault. It was because of... (by Yany)
July 2017 Pages: 1234... 6
  Archived months: [jun2017] [aug2017]

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