General C++ Programming - June 2011 (Page 8)

Serialization and strings
 
Hey all Currently trying to make a program to output strings to a binary file, but because i'm using the <string> header - I've been led to assume - they are...
[2 replies] Last: The size() method returns the number of elements contained in the stri... (by webJose)
by Bezi
C++ version of calloc
 
In C we can use calloc to intialize a dynamically allocated array all to zero, I am trying to avoid calloc and use new instead but I cannot initialize to...
[1 reply] : C++ 03 sections 5.3.4 and 8.5 refer. You can do this: new int (); ... (by Moschops)
by JRevor
Scope problems?
 
Hello, At the moment, I'm working on a university project that uses the OpenNI kinect library, to do image processing. I'm having the following problem ...
[2 replies] Last: First of all, sorry for the tripe post. Eventually, I decided to scra... (by JRevor)
sum for -should be easy but im stuck
 
Hi all, I have been working on trying to sum the netpays so that I can get an average as well. I think the issue is within the while loop I have created. My ...
[3 replies] Last: Thanks everyone for the help. As you can tell I am new at this. Than... (by mike6497253)
by paeez
sorted array
 
hello dears I have one problem in my program . It has 2 array like arry1:{2,2,2,3,1,0,0,0} arry2:{3,2,2,2,1,0,0,0} Now I want to get this array from ...
[4 replies] Last: You can't really set the list items in arry1 to a null value unless yo... (by get funky)
FTP Upload
 
Can anyone provide me a c++ program that can upload files to my FTP server, need complete explanation am just a beginner.. Thanks in advance
[2 replies] Last: I have to mention I have a cpp program which creates an HTML page with... (by heman0154)
How to make a divsion comparison
 
I am building a small math game and i am having trouble with the division portion of the game. ex. float a,b,answer,trueAnswer; cout<<"enter val...
[2 replies] Last: you could use integers and multiply them to get trueanswer (by buffbill)
Mixing #define and #if
 
Hi everyone, I need to write conditional debug program which inserts debug statements depending on debug levels. I have the following code. However this resu...
[2 replies] Last: Hi helios, Even I thought the same way but felt may be missing someth... (by nkumar85)
Virtual Functions
 
I'm rather confused as to how virtual functions work. I made this example: Header (sandbox.h): #ifndef SANDBOX_H #define SANDBOX_H class Sandbox { pu...
[7 replies] Last: I was looking for the pImpl idiom... my bad >.>. (by closed account S6k9GNh0)
2 and 3 dimensional arrays
 
Hi guys, i am trying to write codes using multidimensional arrays, the program should output the names and grades of 10 students writing 6 exams, i have inclu...
[1 reply] : First of all, please use the "Source code" button for pasting the code... (by vonpik)
Making String arrays out of long files.
 
Ok so I have this code written and all it is supposed to do now is simply take the command line arguments, look in the file, and combine all the names in that f...
[4 replies] Last: Thanks for the advice that will most likely help. It makes sense at le... (by pcaraglio)
Nameless structs in a class
 
It's sometimes useful to group some variables in a class together inside a nameless struct: class foo { struct { unsigned a; string b; } bar; public: ...
[3 replies] Last: Thanks for your help. I'll just make it a named class then (leaving it... (by anonymous23323124)
by Pufo
Nonconstant parameter for a template class
 
I have a template class from an API that is instantiated with something like this. BitField< length > object; The problem is that length variable is onl...
[2 replies] Last: Assuming a bitfield is array of bits, then I would suggest boost::dyna... (by kev82)
by majora
Running Allegro On 64bit windows
 
I am having trouble using allegro. The code is faultless but the files will not run on a certain computer. My home computer runs them fine but the other will us...
[1 reply] : The 64-bit edition of any Windows OS will have a conversion layer that... (by ModShop)
cout not working
 
Hello I am fairly new to the c++ environment and I tried writing a simple Hello world application (see code block) however I got a error message saying that cou...
[8 replies] Last: Thanks for the help people, I tried a different compiler on another co... (by GeckoLink)
replace() with string
 
Why can't I do this using replace(): http://www.cplusplus.com/reference/algorithm/replace/ string str = "apple"; str.replace(str.begin(), str.end(), 'p'...
[4 replies] Last: Got it. Thank you very much guys! (by nguyentrang)
Help me please
 
Hi, I have problem with the values that are gained from MATLAB and C++. First I run this program in C++ and I got the value of 4.469996e-6 for "tmass" in the p...
[9 replies] Last: Thanks every one the problem solved successfully with your suggestions... (by amir1987)
Confused beginner needs help
 
So I've been reading through Programming Principles & Practice Using C++ and I got the the part where he takes you through the process of making a simple calcul...
[2 replies] Last: Okay even though I have no idea what you've done as we haven't covered... (by Cppcats)
by gizzmo
operator overloading
 
Hi, How can I overload operator and = so that I could do an assignment like object = something; object = sonethingelse;
[4 replies] Last: I think you misread the original post, Edithsong. Wazzak ... (by closed account zb0S216C)
Runtime & Compiler Errors with Resource Manager Template Class?
 
Hello, CPlusPlus community. I am writing a Game Engine and I can't seem to get the hang template classes. I understand the basic principals but when it comes to...
[2 replies] Last: Thank you! And the forward declaration was just me trying different th... (by KeyForge)
June 2011 Pages: 1... 678910... 28
  Archived months: [may2011] [jul2011]

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