General C++ Programming - June 2012 (Page 3)

user defined function and fopen customised file name
 
Hi, I am trying to simplify my program using user defined function. The function is basically going to be creating a file with the customised name. My function ...
[1 reply] : you need a string not a char for this: format("1188AC"); ... void form... (by coder777)
Possible memory mismanagement
 
I have been trying to trouble shoot this error now for a while and I am at a standstill right now. The code I've written seems to run start to finish but when t...
[3 replies] Last: What platform are you running on? There are some heap checking tools ... (by kbw)
problems with SFML
 
hello i have just started learning to work with the SFML library but it doesn't work yet. i was following this tutorial: http://sfml-dev.org/tutorials/1.6/start...
[2 replies] Last: found the problem. downloaded some wrong version of SFML... (by gelatine)
by Disch
Concurrent multithreading sync issues
 
Okay everyone, I have a problem that is KILLING me. I'm reaching out to you guys in hopes that someone can point out the problem. Long story short Mute...
[18 replies] Last: They guarantee that once a variable in one thread is written, other t... (by coder777)
Access other class member function
 
Hey.. I got in trouble here... I'm trying to do this: fileA.hpp extern class A { public: int functionA(void); friend class B; } objectA; file2.cpp...
[1 reply] : in fileA.hpp you declare a gobal variable 'objectA' which must be defi... (by coder777)
by ToniAz
-O3 Flag Disappoints Me
 
Hello everyone! I've been working on a program whose body contains a quadruple-nested loop. In each of the three inner-most loops, there is allocation of aroun...
[7 replies] Last: If you have determined that memory allocation is slowing your down T... (by ne555)
hw problems
 
1. Write a C++ expression for the following algebraic expression. c = a^3 / (b^2k^4) 2. What is the output of the following code? #include <iostre...
[1 reply] : [quote=qwert123]1. Write a C++ expression for the following algebraic... (by webJose)
C++ with Google Chrome
 
I'm fairly new to C++ and was just wondering if it was even possible to write a program that could manipulate certain things in Google Chrome? For example, I wo...
[4 replies] Last: Thank you guys, ill take a look at these. (by i2Fluffy)
by Hucaru
FFTW - Cannot see where I am going wrong
 
Hi, I am using the fftw library to perform a Fourier Transform on data that I read from a file and then output the transform into a new file. I have compiled t...
[2 replies] Last: Your data has no oscilation, which means it has a frequency of 0. ... (by htirwin)
preprocessor stuff
 
Is there a way to detect if a system is using the /proc/ directory at all? I want to avoid detecting this in the runtime code because it would eat a little time...
[5 replies] Last: Thanks, I distribute binaries and source so it is gonna have to be the... (by awsdert)
Size() on static arrays inside a class.
 
I've been trying to using the command .size() to get the size of the arrays instead of creating a variable which is the same size of the array. I'm manually put...
[6 replies] Last: thanks for the help, it is much clearer now. (by forceface)
read string by word by word
 
Hi im not talking about read word from outside source. let say i declared string string temp = "hello my name is temp"; I want to put word by word to s...
[2 replies] Last: plain C++: #include <string> #include <sstream> #include <vector> us... (by Cubbi)
Including an assert into the constructor of a class via if
 
Greetings everyone. I'm working on some stuff for university right now and I've stumbled over a problem I can't figure out right now, but I'm pretty sure one of...
[2 replies] Last: Thanks alot, it works. Was as simple as I though. Already had it like ... (by redpaperlantern)
Grading Program and Boolean Variable Confusion!
 
Okay Im a newbie and Im working on a program that allows the user to enter a grade (0-100) and then the console returns to the user the grade and the letter of ...
[2 replies] Last: Also you can simplify your code for example if (grade >= 90, g... (by vlad from moscow)
by jorgen
Windows.h doing something strange
 
I have a code (a long one, so I won't include it) which works fine, and then I want to include Windows.h (by writing #include "Windows.h" at the beginning) to u...
[8 replies] Last: It's not the first time, that happens to me. (by Caligulaminus)
Virtual Inheritance
 
Lets say I have this code: #include <iostream> using namespace std; class Animal { public: Animal() { cout << "Creating Animal\n...
[13 replies] Last: Oh, okay! Sorry, I thought you were talking about the code I posted (C... (by BlackSheep)
switch case scope formatting
 
This is a code formatting question. In writing switch statements I usually don't indent the case labels. Code like this looks nice and I'm happy: switch (num...
[2 replies] Last: and i format it like this: switch (number) { case 1: { /... (by luza)
by vinu
segmentation fault whne using list::remove_if
 
I am trying out the stl concepts and started facing the segmentation fault when using remove_if of list. Following is the code I was trying. i am not compelete...
[3 replies] Last: The member function remove_if removes all elements of a list that sa... (by vlad from moscow)
What include file is needed?
 
to use Kill(); ive tried #include <iostream, Windows.h> and thats all that comes to my mind.
[13 replies] Last: thnx system("taskkill /im notepad.exe"); worked. (by Invader2010)
fille read/write
 
Hello. My program doesn't do its task well.What's wrong? #include <stdio.h> int main() { char buffer ; FILE * inFile; inFile = fopen("g:...
[6 replies] Last: Looks good-ish. In the old code, you was writing at the end because y... (by closed account 3TXyhbRD)
June 2012 Pages: 12345... 33
  Archived months: [may2012] [jul2012]

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