General C++ Programming - May 2013 (Page 22)

Problem with converting CString to Int
 
Hey,I am having problems with converting a CString to an int and than doing checks on the int to see if it is in a particualr range. Below is a general idea of ...
[5 replies] Last: [quote=L B]CString is a Microsoft C++/CLI class. No, it's an ATL/MFC ... (by naraku9333)
Should be simple tile collision
 
Well, simple tile based collision... Why can't I do This?!?!? White Rectangle Represents The Player http://puu.sh/2TBhT //Floats in air http://puu.sh/2TBif ...
[6 replies] Last: Found out the issue, the collisions were right, the rendering was wron... (by Pickle Gunner)
Problem with vectors, classes and inheritance
 
Hello, I'm writing a project in C++, and I am stuck on a problem I don't know how to handle. I have the following classes: class entity { fr...
[5 replies] Last: They shouldn't be friends in the first place ;) (by LB)
Destructor for multi-dimension array
 
Hello, I have written the following destructor: ImportCSV::~ImportCSV() { for (int i = 0; i < righe-firstRow;i++) delete price ; delete pric...
[4 replies] Last: Thank you for the suggestion L_B. If I call the destructor without pop... (by alpignolo)
Blinking Window in SFML
 
using SFML in visual studio 2012 .... this code gives blinking window. can anyone tell me how to fix it .. or fix it .. #include<iostream> #include<SFML\Grap...
[8 replies] Last: not working... would appreciate any help... (by Sohil Shrestha7)
1 Strange Error: Finding an int from file containing mixed (int, char) data.
 
I'm removing a line from my file. User enters record. And the line containing record in the beginning is replaced by SPACES. (This is what I thought to delete a...
[4 replies] Last: How the 2) and 3) points are done? 2) How to copy data to temporary bu... (by Rehan FASTian)
Calling function from another class
 
class Destination { .... private: CityNameType city; // name of the city where the packages are sent int package_count; // count of packa...
[3 replies] Last: Why is PrintCityName in DestinaionList? It doesn't use any of the memb... (by LB)
What is the error?
 
#include<iostream.h> #include<conio.h> #include<stdio.h> struct BOOK { int Bno; char Bname ; char Author ; float Price; }; void EnterDeta...
[3 replies] Last: Hmm..thanks! :) (by Winkerd)
int( 5 ) - cast or constructor?
 
Like the title says, if I have this code: #include <iostream> void f( int num ) { std::cout << num << std::endl; } int main() { f( int( 5 ) ); ...
[3 replies] Last: Ok, thanks. So there is no int constructor at all? I always thought th... (by Fransje)
Don't know what the error is
 
#include<iostream.h> #include<conio.h> #include<stdio.h> void EnterDetails(); void DisplayDetails(BOOK); void SearchByBno(); void SearchByBname(); str...
[2 replies] Last: Hmm thanks :D (by Winkerd)
by Medino
Take comments from c file and store it in a text file.
 
Does anyone have a c++ code that will take the existing comments from a arbitrary C file, and store those files in a text document?
[4 replies] Last: You're welcome :) (by MikeyBoy)
Quick question learning OOP. Const or no const in the function prototype?
 
Hey guys I've got a quick question I hope someone could help me answer. My computer science class has started in the topic of object oriented programming and my...
[4 replies] Last: The "void" in the parameter list comes from C. You shouldn't use it in... (by S G H)
by jparr
Making objects bounce off eachother
 
Hi, Im attempting to make asteroids bounce off eachother on collision. I have setup rectangles and tried to do this code: Rectangle asteroidRectangle...
[no replies]
Problem with strcpy function
 
I'm having a problem using the strcpy function. It works up to a certain point, and then I get this error message "The variable src has not yet been assigned ...
[2 replies] Last: CityNameType If it is typedef for char*, you need to allocate memor... (by MiiNiPaa)
by labeeb
file handling
 
Every time I write in file using ofstream it works fine except for one thing that when the file is re-opened after writing something and we try to add more data...
[1 reply] : You need to use the ios::app flag in order to to append to the end of ... (by BigBlackSheep)
by h0404
Thread-safe class
 
Hello everyone, I have started to use C++, and I am stuck with an issue. Can anyone explain what is a Thread-safe class, and what does it mean to write a ...
[2 replies] Last: Thank you can you please advice a C++ book which can be helpful like ... (by h0404)
calling a function that holds struct arrays
 
In this program I am attempting to allow a user to input three different authors and then input three books they have written as well as the price. I am struggl...
[3 replies] Last: You're welcome ngeisler. That's good to figure out logical errors your... (by Rehan FASTian)
Compiles with 0 error but when I run it. 2 Errors appear
 
Error: --------------------Configuration: nc - Win32 Debug-------------------- Compiling... cv.cpp Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved e...
[1 reply] : Function main may not be a template function. So remove statement with... (by vlad from moscow)
Printing Out Time Every Hour
 
I have made a basic function to print the time every hour. It gets called every tick and will only print if the minutes and seconds are equal to 0. Since it get...
[no replies]
Issues with findtitle function.
 
HI!. So Im good with everything except when I call the printone function in the findtitle function. Basically, I am sending a string str as a parameter to the f...
[no replies]
May 2013 Pages: 1... 2021222324... 47
  Archived months: [apr2013] [jun2013]

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