General C++ Programming - May 2016 (Page 5)

Little question about ->* and .* (pointer-to-members)
 
Hello. Here is a simple example for my question struct Person { int age; void print() { cout << "Age is: " << age << endl; } }; int m...
[1 reply] : #include <iostream> struct A { int mf( int a ) { return m += a ;... (by JLBorges)
how to implement a c++ reference count macro?
 
Is there any way to add something like "ADD_REFCOUNTER" to a class and then each ctor and dtor of this class will be monitored to ensure no memoty leaks happen?...
[2 replies] Last: thanks very much! it is really useful (by sunsflower)
by kubu
Passing Variable Argument to DLL
 
I am working on a plugin architecture where each plugin requires a different set of input arguments. These inputs need to be provided through a GUI by the user ...
[5 replies] Last: To me, it sounds like he's talking about either inter-process communic... (by helios)
Error C2040 varied levels of inderection
 
Currently i'm trying to get the date using the localtime_s function but i'm getting an error. The problematic part of my code is time_t rawtime; struct t...
[4 replies] Last: This should work: #include <iostream> #include <ctime> using namesp... (by Thomas1965)
Starting out with GTest and C++ Unit Tests
 
Hey All, I'm just beginning with Google Test. I think I understand the premise, and want to get started with my first test. Say I have a header file that loo...
[no replies]
final exam
 
last hope i have is this forum write a program which read a string contains a number followed by an operation there anther number (e.g "25*3"), the prog...
[9 replies] Last: mmmmmmmm thanks for your help but that didn't help a lot i still in ... (by CinQabas)
doctest - the lightest feature rich C++ single header testing framework - version 1.0 released!
 
you can find it on github - https://github.com/onqtam/doctest Also read the README.md there - it explains how this library is different from all the rest.
[no replies]
by sarder
Formatted text file reading problem
 
This is the file. R: 10 Steve Abrew 90 80 84 76 David Nag 93 87 90 80 Mike Black Andrew Van Den 90 88 95 85 Chris Smith 86 74 90 Dennis Dudley 74 76 77 83 Leo R...
[16 replies] Last: ok thanks.. i got it... thanks a lot :) (by sarder)
function overloading
 
if you have in a file int fn(int,int,int); float fn(int,int); it compiles fine but if you have int fn(int,int); float fn(int,int); it gives compilation...
[1 reply] : When you call a function, the compiler needs to be able to identify wh... (by Moschops)
by hayyan
hiding user input
 
how can I hide user input and still stores the input in a variable and later print out on the screen?
[2 replies] Last: #include <iostream> #include <conio.h> #include <stdlib.h> using names... (by hayyan)
Prim's Algorithm..How to identify connectivity
 
Hi. I need to know how can I identify connectivity of two nodes? Please give me some hint or code to understand this. Thanks
[2 replies] Last: Thanks (by csstudent123)
by stav
gcc 4.7.1 doesn't support threads?
 
when i try to compile my code with gcc -std=c++11 *.cpp -o main it gives me an error: "thread is not a member of std" my code: #include <iostream> #include...
[3 replies] Last: C++ has come a very long way in the last four years. (by Moschops)
merging alternating vecotrs?
 
Exercise P6.5. Write a function vector<int> merge(vector<int> a, vector<int> b) that merges two arrays, alternating elements from both arrays. If one array is s...
[1 reply] : One way to do it. vector<int> merge (vector<int> a, vector<int> b) {... (by Thomas1965)
by sarder
Splitting characters and int from a character array
 
This the file containing data: R: 10 Steve Abrew 90 80 84 76 David Nag 93 87 90 80 Mike Black Andrew Van Den 90 88 95 85 Chris Smith 86 74 90 Dennis Du...
[no replies]
Skipping columns
 
I am loading my file data to 2d dynamic string array, but the problem is whenever space is encountered column is incremented. For example Expected output: Na...
[3 replies] Last: I don't want to post me email address here. All bots would see it and ... (by Thomas1965)
by kubu
Accessing Files from DLLs
 
I am creating some plugins/dlls that are processing data. The data usually resides in files. The idea is that the filename is passed to the dll which then opens...
[3 replies] Last: Do you know what the important settings are so that an "application" ... (by helios)
Review My Code.
 
Hello everyone! I would just like to ask if my code is acceptable, and see if anyone can give me tips to be a better writer. The Instructions Are: Inside the m...
[7 replies] Last: @Necip Thanks aha i did not know that. will keep in mind :D (by bb0yth0r)
Dynamic 2d array into a struct
 
Hello. How can i add a dynamic 2d array into a struct?
[3 replies] Last: http://stackoverflow.com/questions/936687/how-do-i-declare-a-2d-array-... (by closed account 48T7M4Gy)
.txt files
 
Hi all, i have a question. I have a txt file ready in parts of 1-9. How can i read only one part of the .txt file. For example if i type in br=3; that means i w...
[2 replies] Last: Well i wanted to use integers to separate the parts in my .txt file. F... (by Mrkaiba)
Runtime Error #3?
 
I'm using Visual Studio 2015 and I'm getting a Runtime Error #3 in a program I'm writing. // chapter_3_drill.cpp : Defines the entry point for the console a...
[10 replies] Last: Yeah, I see now. Thanks. It worked with that. (by DragonOsman)
May 2016 Pages: 1... 34567... 17
  Archived months: [apr2016] [jun2016]

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