- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I've been messing around with c++ and attempting to fully understand certain behaviors. Given the following program: [code=C++]#include <iostream> class Test { public: Test(); ~Test(); void func(); }; Test::Test() { std::cout << "Constructor" << std::endl; } Test::~Test() { std::cout << "Destructor" << std::endl; } void Test::func() { std::cout << "Deleting … |
|
Re:
can someone help me do this problem An array can be used to store large integers one digit at a time. For example, the integer 1234 could be stored in the array a by setting a[0] to 1, a[1] to 2, a[2] to 3, and a[3] to 4. However, for … |
|
Re:
it builds correctly and runs correctly but when the program gets to the while statement, it just stops completely, does not even allow blind input of data. I know it is a little messy but here is the code: [code=c++]// buildingwillcost.cpp : Defines the entry point for the console application. … |
|
Re:
Don't know if this is the right place to post this but... I just started with SDL, and get the error: expected constructor, destructor, or type conversion before '*' token With this code: [CODE]#pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDLmain.lib") #include "C:\Documents and Settings\Mikael\Mina dokument\SDL\SDL-1.2.14\include\SDL\SDL.h" #include <cstdlib> #include <iostream> #include <string> … |
|
Re:
Anyone know how to accomplish this task on visual studio with C++? Write a program that reads a series of numbers (doubles) from the user, then prints the mean and the range. Notes: • You do not know ahead of time how many numbers will be in the list. • … |
|
Re:
Hey all I have a bit of a problem, I need a little help fixing this little error problem. The Error is "error C2668: 'sqrt' : ambiguous call to overloaded function" it is on this line of code: [code=c++] void myint::square() { // Output square root cout << "The square … |
|
I'm having several difficulties with memory leaks in a program (I've been using "Visual Leak Detector" to check for memory leaks). I've simplified the code to the following: [code=C++]#include "vld.h" #include "vldapi.h" #include <string> #include <vector> class BaseFoo { public: BaseFoo() {} ~BaseFoo() {} }; class ButtonFoo { public: void … |
|
Re:
I'm refreshing my mind of my C++ skills, and my older brother had the idea of creating a medieval text-based game! He's making all the ideas and all that, and I'm the code monkey programming it. Here's the code: main.cpp: [CODE=c++]#include <iostream> #include <string> #include "CLASHinfo.h" using namespace std; int … |
|
Re:
I have one *.cpp file but I cant it compile with MS VC++ ! How to compile signle .cpp file in VC++? Please help me! |
|
Re:
I'm working on a movie class for a project. I think I've got it reading in movies from a file. I want to test it using the overloaded subscript operator, but the Driver file will not let me enter a movie title to search for. I can't think of a … |
|
Re:
My assignment is to have an even integer greater than 2 entered and to output two odd prime numbers that add to it. We're supposed to use a bool function but I'm having trouble compiling. I'm getting an error that says "ambiguous overload for operator in cin >> variable" No … |
|
Re:
Hello, it the same old program calculator i have corrected errors that were preventing me from running the program. Now that i have done it i am facing another issue; It doesnt perform needed computations such as +-* and etc. It must be my switch fn. Any help will be … |
|
As I was busy inlining some of my functions, I was wondering if it is really necessary to inline anything. Doesn't the compiler automatically inline stuff, or do I have false memories? And if the compiler does inline stuff for me, would it be best to let it do its … |
|
Re:
Hey everyone, I typically don't like to go on forums and throw my code at people and expect answers... but, I'm a beginner (and a little desperate) with all this so a little help would be much appreciated. Here's the details: [LIST] [*]The purpose of the program is to have … |
|
Re:
Hi, May I know how to declare a Class in C++ window application form? Below is my code and error as shown below as well. here is my class declaration: [code=cplusplus] public ref class CLoadObj { public: bool ImportObj(t3DModel *pModel, char *strFileName); System::Void ReadObjFile(t3DModel *pModel); System::Void ReadVertexInfo(System::Void); System::Void ReadFaceInfo(System::Void); System::Void … |
|
Re:
firstly hi all, i''d like to intrroduce myself. Im a new C++ programmer..hardly..but trying..so yes its frustrating with the error and syntax mainly. Anywayz, this is a card game with 2 classes and simple functions but im having a problem compiling it. I compile it on visual studio so i … |
|
I have a vector array of a class that's giving me some crap. I would beat it up, but that might result in some innocent circuits getting damaged. Class: [code=c++]class Font { public: Font(); ~Font(); int style; int ptSize; std::string name; TTF_Font *font; }; Font::Font() { style = TTF_STYLE_NORMAL; ptSize … |
|
Re:
i wanna noe how to write a code that will read lines from a file and then put those lines into an array. and will this make a double of arrayB if arrayA is empty and arrayB is filled? arrayA[10]=arrayB[10] help of any kind will be greatly appreciated! |
|
Re:
I am trying to use sprites, which I made in the form of bitmaps, in my program. Is there a library that will allow me to easily display them? I tried to use OpenGL but my computer will not allow it to initialize. I would simply like to display bitmaps … |
|
I'm creating a multiplayer game using winsock, but I've been having several problems with winsock. I've been searching for an alternative to it, but I haven't found anything. If anyone could point me to something I could use in place of winsock (a free something), I would greatly appreciate it. |
|
I've been getting an "Access Violation" error while running this program: [code=c++]#include "SDL/SDL_ttf.h" class Font { private: TTF_Font *font; public: Font() { font = TTF_OpenFont( "c:\\windows\\fonts\\cour.ttf", 20 ); } ~Font() { TTF_CloseFont( font ); //Access violation } }; int main( int argc, char *args[] ) { if( TTF_Init() < 0 … |
|
I have a header file causing me several errors. It contains a class definition, then I have a *.cpp file with the function definitions. Header: [CODE]#ifndef DOT_H #define DOT_H #include "SDL/SDL.h" #include <vector> class Dot { private: int x, y; int xVel, yVel; vector<SDL_Rect> box; bool check_collision( vector<SDL_Rect> &A, vector<SDL_Rect> … |
|
I have a function which takes an array of SDL_Rect (which is a data structure containing four integers, x, y, h and w), and assigns values to the data members. However, when I try to compile, each line generates the error "error C2059: syntax error : '='". [CODE] int main() … |