General C++ Programming (Page 8)

Compelling use of Friends?
Hey guys, This is more of a general question. Have you ever encountered a scenario where friend f...
[5 replies] Last: Friends are probably a last resort. -1. Friends are part of a class'... (by Duoas)
A struct inside a class?
I'm getting confused. If I have a class declared in class.h and defined in header.h like below. I'...
[6 replies] Last: Okay, I see. Like Cubbi said, you can use :: to access what you decl... (by lsk)
Using Global Variables in a Static Library
Currently I can't test it, that's why I'm asking :) Is it possible to use & change global variabl...
[3 replies] Last: When you include the file that contains the function, won't you have t... (by lsk)
by tcmn
help understanding how to interpret a function
I was asked to write a function : int solution(const vector<int> &A)that, given a zero-indexed arra...
[5 replies] Last: I too sent the wrong example. Here is the example: array A consisting... (by tcmn)
by ikan
Reducing the time complexity
I have a very simple program the time complexity of the function that I used in this program is O(mn...
[5 replies] Last: Thank you all :)))))))))) (by ikan)
please help
can u please find error in the runs upto enter month and continues without stoppin...
[3 replies] Last: Line 1: Correct header for modern compilers is <iostream>, not <iostre... (by AbstractionAnon)
Binary and String File Protection
Hello, I am using private copy constructors to protect my string and binary files. I am wonderin...
[no replies]
by Gamytr
Double, int and float. See the differences.
I don't know where I made the mistake #include <iostream> using namespace std; int main() { in...
[4 replies] Last: Thank you :)) (by Gamytr)
Simple encryption program runtime error
I am trying to make a simple program for encrypting a char* with the XOR operator. The code compil...
[4 replies] Last: Do you know how to do this with std::string and the other C++ awesome... (by cire)
by nines
Needed explanation
Hi, I need help with this code : 1. # include <iostream> 2. # include <cctype> 3. using name...
[3 replies] Last: myesolar & lsk thanks for the tips I will google it and find out (: (by nines)
explaining of codes
can someone explain the function below to me void readFile() { ifstream read("bs.txt"); ofs...
[3 replies] Last: The code seems to do "silly" things and might not even work properly. ... (by keskiverto)
How to know if a variable has been accessed
I wondered if anyone knew how to tell whether a variable has been accessed in memory, no matter what...
[4 replies] Last: The variable isn't encapsulated, it's just a standard C++ primitive va... (by SatsumaBenji)
by bairsh
large array of objects isnt freed
Hello, strange behaviour have seen with large array of objects in the following code. If class inte...
[5 replies] Last: Thanks for the clarification. I'm not able to test the 4.1Gb version a... (by Chervil)
Dangling Pointer Memory
I appear to be having difficulty freeing memory and I think that it may be causing leaks, I could us...
[5 replies] Last: No need to use new for those temp objects, and with the exception of... (by duky)
Is the expression with multiple '<<' full?
Hello to everyone. I need to implement simple wrapper for logging function log(const char *). S...
[2 replies] Last: Thx (by alexvein)
C++ 2D game library
Can you recommend me a 2D game library ( NOT a game engine ) that is similar to Apple's SpriteKit, b...
[5 replies] Last: Thank you very much! I built SFML from sources and added the SFML incl... (by memberfunction)
explaining of codes 2
and this function too void writeFile() { ofstream fout("tmp.txt");//opening file"bs.txt" for ...
[no replies]
c++ vectors struct dilemma
i want to know what the struct is being used for if everything is being stored in the tmp variable...
[no replies]
Random function better than rand()?
So I need my program to very rapidly spit out random numbers. Now I don't remember where I read this...
[17 replies] Last: @cire: if i use a function attribute, that isnt guaranteed to be port... (by cire)
The progran flashes
Hi. Why is it that the program doesn't stop for me to see the output? Here is my code: // accessin...
[1 reply] : (by helios)
Pages: 1... 678910... 45
  Archived months: [may2014]

Cannot post in this page. To post a new message, go to the first page.