General C++ Programming - August 2014 (Page 9)

Problems with class files with SFML
 
Im making a small game is SFML called skelton town. (not skeleton (its a inside refrence)) I have made a file called Player which i want to allow me to make the...
[2 replies] Last: As ne555 pointed out the sf::RenderWindow member is not related to the... (by Z e r e o)
variable inside constructor
 
automatic variables are destroyed upon function exit what about variables created inside constructors if an object constructor creates an automatic variable ...
[1 reply] : All variables declared in a constructor go out of scope when the const... (by helios)
Read certain lines from a file
 
I want to read certain lines from a file. Let say if the line contains word "makes" , the line will be loaded on the screen. Can anyone help me how to modify t...
[1 reply] : http://www.cplusplus.com/reference/string/string/find/ (by keskiverto)
by cGuru
Can You Recommend An IDE?
 
So, I have just started my college C++ course, and on my book companion website it recommends several IDE's to compile my C++ code. They are as follows: - Mi...
[6 replies] Last: I prefere Qt Creator. When I first saw it I fell in love with it (sorr... (by Zloi)
Differentiate a word/letter and number in a string
 
I have one string from user. Let say, "The deviceId is 2" ....but user also can give input like this.. "The deviceId is a" . I just need to know how to dif...
[1 reply] : http://www.cplusplus.com/reference/cctype/ (by LB)
Shared pointer problem
 
Hi I made a vector of shared pointers and when I set the pointer to NULL it should delete the memory right? Opened my task manager got the memory from 780 to 79...
[3 replies] Last: If you choose to ignore what I am saying, I cannot help you. (by LB)
by judo11
How to dry run any c++ programs?
 
I've noticed that in order for us to understand any program is by dry running it using a pen and paper and that is much difficult. Please give me a tips on how ...
[8 replies] Last: you mean like an IDE? (by Homberto)
reading xml weird error
 
hello I am trying to read this xml file this readFile function does not give me right values. Only to use cstring..no pointers or other libs such as xml libs ...
[8 replies] Last: Pls tell me what to do in taglessline function void readFile(char ... (by csstudent123)
Smart pointers in a vector
 
I am new to smart pointers and have a question. If you push a smart pointer onto a vector and then some where later pop it back off it will delete the memory...
[1 reply] : Yes. (by Disch)
Boost memory mapped object
 
i've created dll and implemented shared memory that every connected process can use. My problem is that i can't change anything in object, which is stored in th...
[3 replies] Last: Ah, yes. Sorry, I missed that the first time. static globals are tran... (by helios)
C++ count an array?
 
This is going to seem like a stupid question but how can I count the elements of a const array. Surely c++ compilers provide a count for const arrays? const ...
[2 replies] Last: Using sizeof with class member arrays does give the length. sizeof(arr... (by helios)
by pluk
sdl memory leak!
 
hello! i have a memory leak in my game and i can't find the problem. here is my code(its a mess) : main: #include "game.h" int main(int argc, char *arg...
[2 replies] Last: My first question would be how you determined a memory leak exists. (by helios)
n queens problem solutions
 
Hi, We want to share our codes, with the purpose to help you write your own c++ solution for the n queens problem. http://ncomputers.org/content/code.php?src=...
[no replies]
by Anns
Restrict header file inclusion
 
Hi, I have one requirement. I have a project lets Say baseProject.vcxproj. It has some header files. Another project lets say dependentProject.vcxproj loads ...
[6 replies] Last: No. This is what the compiler's search paths are for. As part of your... (by Duthomhas)
help reqd for fibonacci series program
 
#include <iostream> void main() { int i; int j=0,n; cout<<"enter number of terms you want in Fibonacci series"; cin>>n; for(i=0;i<=n;i...
[1 reply] : Please, use the code tags and informative indentation: http://www.cplu... (by keskiverto)
a function-definition is not allowed here before '{' token
 
When I try to compile I get the following error: C:\...\main.cpp|13|error: a function-definition is not allowed here before '{' token| I know this can be cau...
[3 replies] Last: Well, while we're at it, in base.h on line 70 there's a stray ++. (by helios)
Not expected result for my function
 
Hello, there is some problems in my program. In the function void print(int num, int line, char letter ), I have to make 4 features there. 1. This function ac...
[3 replies] Last: I would like to save the actual values of the factors (by Johnluk)
by ToniAz
Enforcing that a function does not modify dynamic array pointed to by pointer
 
Hello everyone, In case the question was not very clear. Say I have the following code: int sum(int * x, size_t N) { int sx; /* returns sum of eleme...
[9 replies] Last: BTW, that is supposed to be C and not C++. [...] Why do I need a cast... (by helios)
Avoiding Move
 
Hi, Is there a way to make sure that no move constructors or move assignments are ever called? I tried declaring privately and not defining the functions, bu...
[2 replies] Last: Thanks! (by smcguffee)
Eclipse, input / cin
 
Hello i am using Eclipse and don't know how to test my program when i use cin for example when my program is running, type in a number and so on.. does anyone k...
[2 replies] Last: When you use cin, in most cases your program have to get input from th... (by Jacobhaha)
August 2014 Pages: 1... 7891011... 25
  Archived months: [jul2014] [sep2014]

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