49,757 Topics

Member Avatar for
Member Avatar for JackDurden

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 …

Member Avatar for Ancient Dragon
0
128
Member Avatar for pusangkinalbo12

make a simple calculator involving the following operations addition, subtraction, multiplication, division, square-root, and percentage!! using c++ program..thankz!! :)

Member Avatar for Aia
-1
42
Member Avatar for pdp8

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 …

0
69
Member Avatar for soppyhankins

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 …

Member Avatar for soppyhankins
0
249
Member Avatar for JackDurden

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 …

Member Avatar for Radical Edward
0
144
Member Avatar for saneeha

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 …

Member Avatar for saneeha
0
849
Member Avatar for ederX

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 …

Member Avatar for Radical Edward
0
1K
Member Avatar for vulpecula

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 …

Member Avatar for Lerner
0
168
Member Avatar for Clockowl

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] << …

Member Avatar for Clockowl
0
107
Member Avatar for ++C LOVER

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 …

Member Avatar for peter_budo
0
144
Member Avatar for scjohnny

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 …

Member Avatar for ArkM
0
76
Member Avatar for Clockowl

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 …

Member Avatar for Clockowl
0
115
Member Avatar for death_oclock

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, …

0
69
Member Avatar for glecymay

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

Member Avatar for glecymay
0
192
Member Avatar for JaksLax

[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; …

Member Avatar for cikara21
0
108
Member Avatar for guest7

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; …

Member Avatar for Radical Edward
0
232
Member Avatar for coveredinflies

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.

Member Avatar for ArkM
0
437
Member Avatar for matt_hates_code

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 …

Member Avatar for matt_hates_code
0
118
Member Avatar for CoolGamer48

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 …

Member Avatar for Radical Edward
0
144
Member Avatar for robertmacedonia

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 …

Member Avatar for William Hemsworth
0
252
Member Avatar for NekoGráfico

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; …

Member Avatar for NekoGráfico
0
104
Member Avatar for saneeha

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 …

Member Avatar for saneeha
0
200
Member Avatar for nadiasheikh

Hi, How to achieve hashing in C++? Can you explain this giving a small example? rgds

Member Avatar for CrazyDieter
0
102
Member Avatar for iansane

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 …

Member Avatar for iansane
0
249
Member Avatar for Manutebecker

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++) { …

Member Avatar for JaR
0
114
Member Avatar for arun_lisieux

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: …

Member Avatar for arun_lisieux
0
170
Member Avatar for arun_lisieux

Hey ppl, I was browsing thro the topcoder sample problems and came up with this one. Plz suggest some good algorithm for this. Problem Statement Note: Please keep programs under 7000 characters in length. Thank you Class Name: SquareDigits Method Name: smallestResult Parameters: int Returns: int Define the function S(x) …

Member Avatar for arun_lisieux
0
190
Member Avatar for olagh

Hi everybody, I want to declare a class having an object of another class as its member data. but I recevie compiler error: "No appropriate default constrctor available" my code samlpe is as follows: [code] class bigInt { bigInt(unsigned); bigInt(const bigInt &); unsigned *value } class RSA { RSA(unsigned); bigInt …

Member Avatar for olagh
0
150
Member Avatar for JackDurden

I keep getting an error "cannot convert parameter 1 from 'char (*)[15]' to 'Student_Type *" in the swap call. gradclass is a struct and Student_Type is the name of the struct. Im trying to sort names with this. Anyone know how to fix this? [CODE=cplusplus]void SortNames(Student_Type* gradclass, int i) { …

Member Avatar for ArkM
0
141
Member Avatar for Psykocyber

Hi I'm trying to use a vector to store function pointers, but when implemented in a class there method ceases to work. Class header: [CODE]std::vector<void (*)()> fns[/CODE] Class .cpp file: [CODE] fns.push_back(Search); fns.push_back(Print);[/CODE] Search() and Print() are (public) members of a class named Movie. This code is currently placed in …

Member Avatar for Psykocyber
0
5K

The End.