49,761 Topics
| |
I've have a class function below (using fstream) for my game that I had working on Visual C++ 2008. When I tried to port my app to xcode, I found it compiled, but complained that the directory doesn’t exist. Believe me, the directory exists. I've checked and rechecked! Basically this … | |
| Hey, I am having a really weird problem with my OpenGL Program. When I compile it in Debug mode and run it through Visual Studio 6, it works fine, but when I run it from windows, it works fine until the part where you go to manipulate the camera of … |
I feel that all or almost all of the stack arrays needs a stack header... well this is the project target... I need to input a postfix algorithm an check whether it validates or not... I'm not very familliar with headers could some one suggest it for me or make … | |
| Hi All, Could anyone listdown the differences between pointer & reference?? |
I know I already posted this but I guess I cant do it the way it was shown. I want a 2-dim array to print out on the same line as string word. I cant seem to figure out how to get a 2-dim array to do this, does anyone … | |
make a simple calculator involving the following operations addition, subtraction, multiplication, division, square-root, and percentage!! using c++ program..thankz!! :) | |
The following pertains to a Windows XP Embedded system running a single C++ application with administrator privileges. I need the application to read several bytes of data from the BIOS ROM. The data to be read will have been previously stored in the BIOS ROM at a known address when … | |
Hello again! I am trying to make a jump and run game using SDL, but I am stuck at the jumping part. Whenever I press the Up key, the sprite should go up. However, when I press it, it goes down. I have changed it and done math that should … | |
I want a 2-dim array to print out on the same line as string word. I cant seem to figure out how to get a 2-dim array to do this, does anyone know how to do this? [CODE]void Sort(string word[],float grades[][8], int number) { int i,j=o, temp; string aName; float … | |
Can any one guide me how can i write a byte array to a file.. I am using ofstream class function write().. but it only accepts char*, can any tell me some other function or any way of conversion..ma code is: [code]Byte array[512]; //....the array is initialized using memcpy()....// fstream … | |
Having a hard time here, Im not great with pointers and arrays yet, can anyone tell me how to properly pass a char array, i thought this was right but the compiler is complaining with: I know the bubble sort is incomplete, i just wanted to quickly test the passing … | |
Hi everyone, I have a opened and read a file in a program that I am working on. I have the following informantion in the file: string intstring intstring intstring intstring intstring int string intstring As you can see, starting with the second string, the string starts right next to … | |
Hi guys, Could you tell me what's wrong with this code? I don't get why the compiler says it can't find a matching function... [code=cpp]#include <iostream> #include <vector> using namespace std; template <class T> int printVector(vector<T> &x){ for(unsigned int col = 0; col < x.size(); col++){ cout << x[col] << … | |
guys! please help me to choose language (c++/J2ME) for mobile application! Actually I decided to do in c++ but some of my friends say it is not a good idea to do it! so please tell me which language I should select for S60 mobile phones to do project and … | |
b) Create a class called Company which contains a pointer called PtrArr which is used to point an array of employee objects and 1 integer data member. The integer data member will be used to store the number of existing employee currently. [make sure you have a proper constructors to … | |
Hi guys, I'm getting a segfault and I don't really understand why.. Here is the code n, i, quadcount, quadPerVert and quadindex are all (arrays of) unsigned integers. [code=cpp]unsigned int *quadsPerVert = new unsigned int[quadcount * 4]; //(...) vector<vector<unsigned int> > quadsPerVertIndex; quadsPerVertIndex.reserve(quadcount * 4); for (n = 0; n … | |
I am making a blitting call on my backbuffer: [CODE=C++] BOOL drawImage(IMAGE *lpImage, LONG x, LONG y) { RECT rect; rect.left = x; rect.top = y; rect.right = x + lpImage->lWidth; rect.bottom = y + lpImage->lHeight; dwVideoErrCode = lpBack->Blt(&rect, lpImage->lpSurface, NULL, DDBLT_WAIT | DDBLT_KEYSRC, NULL); if(dwVideoErrCode != DD_OK) { MessageBox(NULL, … | |
hello i hope you can help me :icon_question: i just want to know how to code binary value to decimal value using c++ im willing to wait for your response :) thanks a lot godspeed | |
[ICODE] /* * Global Tech's employee system */ #include<iostream> using std::cout; using std::cin; using std::endl; #include "Person.h" int main(){ Person employee("Sue" , "Jones"); cout << "Employee Info " << employee.getFirstName() << " " << employee.getLastName() << endl; return 0; } /* * Person Class Definition */ #include <string> using std::string; … | |
Hi, I am trying to read the file (f1.txt) which contains : 3 0 -6 0 4 0 -8 0 ... I wish to read the first number from consecutive 2 lines and process them. Following is my code: std::vector<int> row; std::vector<std::vector<int> > two_node; int main() { string line1, line2; … | |
Hi, sorry if this has been asked before I did a search but couldn't find it. How do I define a pointer to a 2D array? (I am trying to pass it into a function). Thanks. | |
Ok I'm using the GCC compiler in C . I have a tree style of menu that has been designated function "Manager". I want to return to the top of the tree so basically what I do is at some point from within the "Manager" function I make the call … | |
Hey, I'm learning Objective-C, and they use [ICODE]#import "File.h"[/ICODE] instead of [ICODE]#include "File.h"[/ICODE]. The tutorial I'm using says that import is like an include once thing, and it basically implements the #ifndef blocks that's normally done manually in C++. I was just wondering if this is something specific to Objective … | |
Hello, I was just looking up the threads and I must say I saw a lot of codes with "std::string", "std::cout", etc... I just wanna ask, wouldn't it be better if you just wrote "using namespace std" instead ? I am doing it all the time, but if it's wrong … | |
Once the object is copied to the vector the pointer isn't updated. If I use a copy constructor to fix this problem I get awkward results. Could anyone please help me find a solution? Thanks in advance. [code=C++] #include <iostream> #include <vector> using namespace std; typedef struct { void *map; … | |
I am using memcpy()function.. memcpy(&_bpb, bBootSector, 512); where _bpb is the variable of structure, bBootSector is byte array the whole progran works fine but at the exit it generates the following error: "[B]Run-Time Check Failure #2 - Stack around the variable '_bpb' was corrupted[/B]." Can any one please guide me … | |
Hi, How to achieve hashing in C++? Can you explain this giving a small example? rgds | |
Hi, I've been looking around for how to execute another application from a c++ app. I remember in VB I could have my app launch the browser or other app and could even have it launch command line with the commands I wanted the system to run. I have found … | |
I want integers 1-52 to be drawn only once, so every "card" will be seen and not one picked twice, heres the code [code] #include<iostream> #include<time.h> #include<string> #include<stdlib.h> using namespace std; class Player{ int hand; }; int main() { srand(time(NULL)); int deck=53; int *drawn; int notdraw[52]; for (int n=1;n<53;n++) { … | |
Hey ppl, Im trying to solve some problems for topcoder website for practice purposes. But the compiler shows the following error for the codes i've been compiling. I have no problems compiling these codes with Borland C++. I've posted the errors and code below. Errors: Your code did not compile: … |
The End.