51,593 Topics

Member Avatar for
Member Avatar for someguy88

Please help me im having trouble with a dice roller im making. Its kind of working except i was wondering why it is that every time i start it up it always throws up the same numbers in a row if you put in 100. It probably does that with …

Member Avatar for Narue
1
98
Member Avatar for imonriddilin

for my c++ class we are writing a simon program (the game where you have to remember and follow the pattern given to you). each turn the program outputs either r, b, g or y to the current pattern (output should look like this: turn1: y 2: yg 3:ygy 4:ygyr …

Member Avatar for n.aggel
0
130
Member Avatar for zanaja

I created one Function in VC++(which is COM EXE) which i want to call from my VB code. I am passing Arguements as Variants from VB. In VC++ i filled SafeArray in those Argument.But after returning its showing Empty.. Here is my VB Code Private Sub Form_Load() Dim obj As …

0
57
Member Avatar for CaliVagabond

I've been tring unsuccessfully to find information on what each language, C and PHP, have to offer in terms of working with MySQL. Just wondering if anyone out there has preference for one or the other and why. I understand that PHP is supposed to have alot of built-in functionality …

Member Avatar for iamthwee
0
117
Member Avatar for cbgreene9185

I'm trying to write a program for my c++ class that takes binary numbers and converts them to decimal. I have programmed this all fine and dandy, but I'm having trouble with my EOF statement. The program requires that I use 3 functions, the first being to prompt user for …

Member Avatar for Ancient Dragon
0
94
Member Avatar for ampdoc

[code=cplusplus] cLass lunch { private: float cost; int calories; public: lunch (); void set cost (float c); void set calories (int c); }; luncn: :lunch () { cost =0.0; calories =0; } void : :lunchdisplay() { cout <<"lunch costs"<<cost<<endl; cout<<"it has"<<calories<<"calories<<"calories"<<endl; } void: :lunch: :setcost (float c) { cost += …

Member Avatar for Ancient Dragon
-1
129
Member Avatar for curt22

I'm working on a simple program. It will compile,but whenever I press the delete button a message pops up and says it needs to close. I looked at the error details and It's error code was 0xc0000005. This is where I think the problem is: [CODE] for(i= 0; i < …

Member Avatar for Ancient Dragon
0
143
Member Avatar for louise07

NEED help please. here's our code. We wanted to print its output file. what function will we use? how will we do it? .We wanted to add printing in the menu.thanks [code] #include<iostream.h> #include<stdlib.h> #include<conio.h> #include<stdio.h> struct node{ int x; char h[50]; //last name char fn[10]; struct node *next; }; …

Member Avatar for louise07
0
117
Member Avatar for curt22

I have a list view and I'm trying to get all of the text out of it. This is my code so far: [CODE] for(i= 0; i < NumOfItems; i++) { char *text = new char[256]; char *text2 = new char[256]; // mask ListView_GetItemText(hWndListView, 0, 0, text, 256); ListView_GetItemText(hWndListView, 0, …

Member Avatar for curt22
0
126
Member Avatar for Necrolis

[code=C++]#include <fstream> #include <iostream> using namespace std; char * buffer; long size; int main () { ifstream infile ("d2gfx.dll",ifstream::in); ofstream outfile ("d2gfx.dll",ofstream::out); infile.seekg(0xBD30,ifstream::beg); size=infile.tellg(); infile.seekg(0xBD30); buffer = new char [size]; infile.read (buffer,size); cout << buffer << "\n"; system("pause"); outfile.seekp(0xBD30,ifstream::beg); size=outfile.tellp(); outfile.seekp(0xBD30); outfile.write ("D2Mad.dll",10); delete[] buffer; outfile.close(); infile.close(); return 0; }[/code] …

Member Avatar for Ancient Dragon
0
89
Member Avatar for n.aggel

I just started learning about stl.... the problem is that 3 cases that i consider "equivelant", don't do the same thing...so the question is, why they are not equivalent? here are the statements: [CODE]cout<<(char)toupper(*pos)<<" "; //this works![/CODE][CODE]cout<<toupper(*pos)<<" "; //without cast it doesn't work, why?[/CODE][CODE]*pos=toupper(*pos); //and this also doesn't work cout<<*pos<<" …

Member Avatar for n.aggel
0
404
Member Avatar for lotsofsloths

I need help with this problem, ok so I am making a program for my brother that randomizes 2 things, a Number(1-6) and a Letter(A-E), I go for the randomize 2 numbers, one for the number, and one for the letter. So i was going very well, until I compile …

Member Avatar for lotsofsloths
0
179
Member Avatar for DemonSpeeding

Okay, so the premise is that this place contains items for sale, and has five of everything that it sells. The inventory is brought in from a file and with parallel arrays you set up the item names with the inventory in stock. I have that all down, but now …

Member Avatar for vmanes
0
114
Member Avatar for dblbac

i have written my homework problem but get 7 errors in it. the errors seem to be comming from this line as well as others like it. any help would be greatly appreciated. this is my first year doing this and is somewhat confusing. I need these lines to be …

Member Avatar for dblbac
0
186
Member Avatar for gator6688

Can someone tell me what i'm doing wrong: [code]#include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { const int MAXGRADES = 5; int i, grade[MAXGRADES]= {0}, count = 0; double Avg, sum = 0; for (i=0; i < MAXGRADES; i++, count++) { cout << …

Member Avatar for Narue
0
158
Member Avatar for robotnixon

Having some trouble with my number guessing game. The object is that the user thinks of a number between 1 and 100 and the computer tries to guess it in a set number of tries. The user inputs an "l" or an "h" if the guess is too low or …

Member Avatar for robotnixon
0
111
Member Avatar for tnvkrishna

i dont understand what the function "flush" does please answer and one more, is there a way that we output a set of data only after a certain while in program execution without storing it in a file and again printing it after reading from that file eg.... i declared …

Member Avatar for vijayan121
0
116
Member Avatar for complete

I am working on a windows XP system. I am doing a command line compile and link using a makefile. It works except for the fact that it cannot find some header files. It has been a long time since I have done this sort of build. I remember that …

Member Avatar for Ancient Dragon
0
76
Member Avatar for indygirl

I am creating a check register for class. We are working on functions - pass by value and pass by reference. I have created all my functions and they seem to be working. However; there is a problem with my currentBal calcuation. When you have an inital transaction the transAmt …

Member Avatar for Ancient Dragon
0
114
Member Avatar for syama.sasi

hi can someone tell me a standard approach 2 solve number pyramids in cpp.some pyramids r easier but what i hav observed is dat every problem requires a different approach.when we r workin on a same environment den why not hav a std approach??

Member Avatar for iamthwee
0
91
Member Avatar for kamlesh_ag07
Member Avatar for iamthwee
0
79
Member Avatar for step2stepgirl

i need help with this assignment i have this class and i need to implement the functions and the main i've implemented it but i want to check if its right and i have a problem in writing the main [code]#ifndef #define class GBook { public: GBook(); void inputGrades(); void …

Member Avatar for step2stepgirl
0
219
Member Avatar for gaasha

How do I "pad" my input to a certain number of bits, say 111 bits more than the original input? Any ideas?

Member Avatar for vijayan121
0
131
Member Avatar for cwarn23

I have downloaded the source code for the .AVI format but when I compile the project, an error is reported which when simplified, is "[Build Error] *** multiple target patterns.". Also, the line which gets highlighted by due to the error is the line 25 which has the phrase "$(BIN): …

Member Avatar for cwarn23
0
349
Member Avatar for terminateproces

Dear board, I'm (trying) to make lil socket app. Its a server app thats supposed to echo back the text I type to it. Problem is, when I telnet to it (i want telnet to be my client) it only accepts one character and spits back only one character. Any …

0
58
Member Avatar for RogerThomasTan

I'm a new user to Visual Studio .Net, writing most of my projects in C++. I have this problem with the OO paradigm when I tried to apply it to my projects. Variables for classes which I described in eg. dXmanager.h fails to appear in my dXmanager.cpp; when I try …

Member Avatar for unicorn11
0
186
Member Avatar for cs1

hi guys i need ur help to do my homework i have this question Write a program that helps students to learn multiplication. Use rand to produce two positive one-digit integer. It should then type a question such as How much is 6 times 7? The student type the answer. …

Member Avatar for vmanes
0
112
Member Avatar for gator6688

I have to place an * beside any grade that gets entered that is below the avg. I was thinking something like this: Am I anywhere close? [CODE]if (grade < Avg) cout << " * grade";[/CODE]

Member Avatar for vmanes
0
63
Member Avatar for jrice528

I just started c++ and programming and need some major help. I am trying to convert binary to decimal. I have searched through everything and its all to hard for me to understand,and uses terms ive never seen. I need to convert the binary to dec, using % and / …

Member Avatar for WaltP
0
123
Member Avatar for gator6688

I have to enter grades and if I enter a negative grade then the program is supposed to terminate. I came up with this code but it doesn't terminate it just asks for another grade. [CODE]if (grade[i]<0) cout << "This is not a correct grade";[/CODE] Any suggestions?

Member Avatar for WaltP
-1
117
Member Avatar for mstrmnd2008

I am creating a program that will convert seconds into hrs mins and the remainding seconds. I've got the hours part down but for minutes im trying to use the remainder funtion. [code=cplusplus] #include <cstdlib> #include <iostream> using namespace std; int main() { int secns, mins, hrs, convs, sec, sph, …

Member Avatar for vmanes
0
116
Member Avatar for jrice528

I have written a binary to decimal program. I have several loops. I was wondering if there is a command... Say the user is done entering binary numbers, cause the program was supposed to be made by entering one at a time. ( homework ) Anyways, The user is done …

Member Avatar for Ancient Dragon
0
47
Member Avatar for mattb_25

Hey guys, i need some help with 2 programs that my teacher assigned me.. I just cant seem to figure them out. I'll type out what the program is, but I really dont have much code to show since I dont really know how to even get started so any …

Member Avatar for Ancient Dragon
0
110
Member Avatar for sarah24

Hi Experts! i need some help now i have written a code but my output is not correct its reading everything from text file but not computing it correctly,,,pls pls help. here's my code.... #include <iostream> #include <iomanip> #include <stack> #include <fstream> #include <string> using namespace std; using std::string; using …

Member Avatar for sarah24
0
108
Member Avatar for sarahger9

Hi, I'm a beginner, so please forgive my inadequate knowledge. I'm am trying to write a program that searches one file for specific words and their replacements found in another file. As of yet, all I have is a program that opens my files and counts the words in them. …

Member Avatar for Ancient Dragon
0
135
Member Avatar for thundaga

hey, i've been doing c++ for uni for a few months and have got an assignment which is giving me some problems... i have to use data from a txt file, import it into c++, perform calculations with it, then produce an output file which is to be made into …

Member Avatar for Ancient Dragon
0
134
Member Avatar for eranga262154

Hi all, I have a console application, and I want to run it though a GUI. Its a simple GUI. Say there is a button called "Run", when I click the button need to execute the application do the task. Can you guys guide me to do it. I'm really …

Member Avatar for n.aggel
0
173
Member Avatar for sean25hun

Iam after doing this program and it isnt working properly , it should give an output like january 1, 1900 february 8, 1985// random number january 1, 1900 may 25 , 1913 // random number january 1, 1900 august 6 , 1912 // random number [code] #include <iostream> using std::cout; …

Member Avatar for sean25hun
0
72
Member Avatar for kako13

Hi, I'm having problem reading a sequential file, I have done some searches all without any positive result. I trying to read a sequential file, but the problem is that the last record is read doubly. Any help would be appreciate. [CODE]#include <iostream> #include <fstream> #include <string> #include <iomanip> using …

Member Avatar for Narue
0
1K
Member Avatar for Schmitty27

Hello thar, I'm working on a problem that needs to input data into a list in sorted order. So far I'm getting some output, but it ignores some of my inserts, (ie "Hammy" in this case) and the output is not sorted. I've looked at this for a while but …

Member Avatar for vijayan121
0
107
Member Avatar for jk_bscomp

Hello everyone..... I hope you could help me with this one..... Is it possible to insert a windows media player using the <windows.h>? If Yes , pls provide me a site where I could learn on how to insert a windows media player. Thanks in advanced...

Member Avatar for GreenDay2001
0
63
Member Avatar for leecey411

Help! My computer started beeping really loud and now I get this message and am a virtual standstill. I am not coputer savy at all, but I did run HJT and here is the log Logfile of HijackThis v1.99.1 Scan saved at 8:51:58 AM, on 10/4/2007 Platform: Windows XP SP2 …

0
48
Member Avatar for jk_bscomp

Hello everyone,,, I hope you could help me on my problem I have encountered in creating an ownerdrawn button using the <windows.h> ... I have already created an ownerdrawn button and inserted a bimap but my problem is that the default shape of the button where I inserted the bitmap …

0
59
Member Avatar for gattispilot

This what I am trying to do. An elevator. so if the newdeck selected is different than where the elevator close the door, move the elevator and open the new door where is has issues is the value of edoor2 doesn't increase so the new door doesn't open. edoor1 does …

Member Avatar for Ancient Dragon
0
90
Member Avatar for step2stepgirl

I've tried so hard to do it but I couldn't so I really need help since I have to send it to my professor tonight so please HELP [code=cpp] class String{ char * const cp; // pointer to the first element int Alng; // the N# of the elements in …

Member Avatar for step2stepgirl
0
121
Member Avatar for driplet

I have the following code, but compiling error message: "cannot convert parameter 1 from 'float' to 'float " when I call flow(v1, v2, v3, v4). Could any one out there help me to find the problem and fix it? Thank you! [code] #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #define Length …

Member Avatar for Salem
0
295
Member Avatar for ubercat

Hi all. I'm a new member [I]I posted the following in the stickied book thread as it seemed the most appropriate place for it. That was 2 days ago and no one responded so I probably guessed wrong. If I shouldn't have reposted, then I'm sorry. Here is the post …

Member Avatar for kako13
0
114
Member Avatar for jaepi

Hello there, I would just like ask what to use if you want to know if a variable is of type wchar_t* or char* using it in a flow control statement. Would this work? [code=c++] void Check(void* pVarToCheck){ if(sizeof(pVarToCheck) == sizeof(wchar_t))){ cout << "Variable is wchar_t*" << endl; }else if(sizeof(pVarToCheck) …

Member Avatar for jaepi
0
989
Member Avatar for jimwalther

Hey, I have no idea why this code isnt working, im new to C++ so maybe im missing some fundamentals or something. But to me it looks perfectly fine.. the purpose of this program is to change binary into user code... if someone could help me out it would be …

Member Avatar for jimwalther
0
164
Member Avatar for DemonSpeeding

So I have a program with a specification file, implementation file, and a client file, I'll post all three but I know the problem rests in the client file. What's happening is that it reads the first team from my data file which I'll also post, and then it doesn't …

Member Avatar for DemonSpeeding
0
102

The End.