51,593 Topics

Member Avatar for
Member Avatar for alone2005

Simplify my problem I put a short version of code here, first header file: [code] namespace xxx{ class util{ public: static int MAX_PATH ; util(); static void init(); static void do(void); }; //end class int util::MAX_PATH ; } [/code] cpp file: [code] namespace xxx{ util::util(){ init(); } void util::init(){ MAX_PATH …

Member Avatar for Dave Sinkula
0
254
Member Avatar for Jon182

Hi guys, I was making a program a few months ago in C++ and in this program I used cin.getline but I found if I used this more than once in the same function some of the cin.getlines would be ignored once the program was compiled. I was just wondering …

Member Avatar for Jon182
0
221
Member Avatar for jcs2380

I also have the same problem my virus scanner says that c:\counter.cab:\counter.exe is infected with a trojan but it cant delete it. Not sure what I should do. Heres my hijackthis log: Logfile of HijackThis v1.99.1 Scan saved at 8:33:14 AM, on 7/21/2005 Platform: Windows XP SP1 (WinNT 5.01.2600) MSIE: …

Member Avatar for crunchie
0
138
Member Avatar for karen_CSE

hi, I know it's me again. It's HW, and I'm supposed to write a program that grades an example of 20 questions. I'm supposed to store the correct answers in an array. And then ask the user to enter the student's answers for each of the 20 questions, whic should …

Member Avatar for Drowzee
0
510
Member Avatar for Kob0724

So I had this nifty program on my calculator that I wrote that sloves quadratic equations for me. I decided it would be good practice to try and write it in C++. I've actually had 4 different versions, each one (atleast in my opinon) getting better than the last. When …

Member Avatar for Kob0724
0
333
Member Avatar for Xeys

I'd like to team up with another beginner in C++ to write a role playing game. I'm a beginner also. Is there another beginner that would like to work with me as a team to make something? Please, no flames. The goal is to write a game that will use …

Member Avatar for Electrohead
0
234
Member Avatar for Rearden

Hello. I'm learning C++ out of Sams Teach Yourself C++ in 24 Hours and Accelerated C++ Practical Programming by Example. I've heard these are both good references. Anyway, I just learned about classes and I was wondering how one makes an array of class objects. here is the Cat class …

Member Avatar for Rashakil Fol
0
263
Member Avatar for shakesahal

I recieved a warning error as below [C++ Warning] HMLP.cpp(4): W8058 Cannot create pre-compiled header: write failed which was refer to the code below #pragma hdrstop After check with help file in Borland C++ Builder 6 the statement was as below This warning is issued when pre-compiled headers are enabled …

Member Avatar for shakesahal
0
207
Member Avatar for jepapel

ok - challenge number 2: What now if i would like to input letters and the letters would be displayed as numbers? For instace i would like to input b a d and it would display me the corresponding numbers. The opposite of what Mr.Dave Sinkula (look thread:[B]Need help with …

Member Avatar for zyruz
0
338
Member Avatar for jepapel

Hi, I am developing a program in c++ and what i want to do is to assign an integer to a character. To become more specific i want to make an alphabet and assign to each letter a number. So far so good. The problem is that i want it …

Member Avatar for zyruz
0
301
Member Avatar for karen_CSE

hi, I'm trying to write a program that separate an array into 2 arrays, odd and even numbers. but I don't know how. can you please help? I'm stuck and don't know how to continue. This is what i have so far //this program accepts 10 integers, stores in an …

Member Avatar for karen_CSE
0
360
Member Avatar for BenPage

Hi there. I am currently working on a project to identify users using their typing dynamics. I want to record the intervals between characters as a user type in their passwords and use these recorded intervals to identify the users. I am using Windows XP and Visual Studio C++ 2003 …

Member Avatar for Electrohead
0
183
Member Avatar for gagan

i m having one doubt regarding hybrid inheritance . i m just a beginner so its not clear to me :confused: DOUBT: WHY THE FOLLOWING CODE IS GIVING AMBIGUITY ERROR #include<iostream.h> class a { public: void f() { cout<<"base class\n"; } }; class b:private a //visibility mode private { public: …

Member Avatar for gagan
0
323
Member Avatar for k_en

[COLOR=Black]hi, i am a newbie and i just started to learn C++. My question is , if i put a number like 45678 in [COLOR=RoyalBlue]char x[6] [/COLOR] then how do i separate each number and put it into [COLOR=RoyalBlue]int num[6][/COLOR].[/COLOR]

Member Avatar for Drowzee
0
380
Member Avatar for djbsabkcb

Below is the start of my source code for a program I am trying to figure out. We have to compute the approximate value of PI with random throws at a dartboard. It is considered a hit if it lands inside unit circle (0,0) and radius 1. Any help on …

Member Avatar for djbsabkcb
0
2K
Member Avatar for cpp noob

hi, as you can see when the value 'a' is to be entered we have to press enter with it too, is there anyway that it can happen by just entering the digit and not pressing enter after it. :eek: # include <iostream.h> # include <conio.h> # include <dos.h> # …

Member Avatar for Dave Sinkula
0
269
Member Avatar for mixsir

I have a part of code that cannot show the result as shown below: patter#1 ***** **** *** ** * pattern2 * ** *** **** ***** pattern3 ***** **** *** ** * Any idea to solve the incorrect code below: #include <iostream.h> using namespace std; int main(){ int i=0 ; …

Member Avatar for zyruz
0
113
Member Avatar for Raven11

Hello, I'm working on replacing functions in DLL files. I most likely will use a trampoline once I get more advanced. However, my question is (I've tried searching google and only came up with crap) how can I find the API in a DLL? I know I will then need …

Member Avatar for Raven11
0
232
Member Avatar for djbsabkcb

Below is my code to calculate interest and balances and how many months to get there. However, my months calculations are way off by the thousands. Any idea? #include<iostream> #include<string> #include<cmath> using namespace std; class Account { public: Account(); Account (double bal); void deposit(double amount); void withdraw(double amount); double get_balance() …

Member Avatar for djbsabkcb
0
2K
Member Avatar for djbsabkcb

Below is a program that determines if one address comes before another address using classes. One constructor takes an apartment parameter and the other doesn't. My errors are invalid conversion from int to const and among others. Any ideas? [code]#include <iostream> #include <stdlib> using namespace std; class Address { public: …

Member Avatar for djbsabkcb
1
988
Member Avatar for synth

Lately I purchased VC++ 6. It worked well for a while until it suddenly ceased to function at all just a few days ago. Here is what happens: Visual Studio opens and runs well enough. I can open a project, edit code, and so on. I can execute my program …

Member Avatar for winbatch
0
236
Member Avatar for Decessus

I'm at the end of chapter 2 of Michael Dawson's Beginning C++ Game Programming. The first exercise at the end of the chapter, has me rewrite a program earlier in the chapter using enumerations. The program is just a simple choose your difficulty level. You enter a number that represents …

Member Avatar for zyruz
0
652
Member Avatar for Drowzee

Well, blast. My first attempt took too long, and I autodisconnected. Short version: Not doing homework, on internship(first gainful employment). Task: Make GUI for existing Console app that takes binary input file. Milestone: By Monday, create windows App that displays output of binary and text input files using MFC. Assumptions: …

Member Avatar for Drowzee
0
274
Member Avatar for 3nCrypti0n
Member Avatar for George2

Hello everyone, I am looking for education materials of developing C++ application with Eclipse. Could anyone recommend some good education materials? Thanks in advance, George

Member Avatar for George2
0
129
Member Avatar for winbatch

Guys, Either there is a bug in the compiler or I'm getting dumber by the day. I want to read an entire file into memory. (Very small file, so no worries about size here). I followed the example here (from [url="http://www.cplusplus.com/"]www.cplusplus.com[/url]) [code]// reading binary file #include <iostream.h> #include <fstream.h> const …

Member Avatar for winbatch
0
319
Member Avatar for Kazastankas

Any clean way to get from one to the other? erase() has been pretty vexing for me.

Member Avatar for Dave Sinkula
0
114
Member Avatar for lallous

Hello i got an assignment to do on classes, basically i got 90% of the program working except for some minor issues which i cant seem to figure out. Here is the code: [code] #include <iostream.h> #include <assert.h> #include <cstring> class weather { private: int day; int month; int year; …

Member Avatar for lallous
0
107
Member Avatar for jhdobbins

im confused as to how to get the pointers to save values... anyone with helpful advice??? this is where i have gone so far.... [CODE]#include <iostream> #include <cstdlib> using namespace std; int main () { typedef struct dataNode { char arriveCity[30]; char departCity[30]; int totalPassengers; int passengers; int flightNumber; struct …

Member Avatar for jhdobbins
0
247
Member Avatar for Decessus

I am just beginning to learn how to program. I'm using the "Beginning C++ Game Programming" book written by Michael Dawson. One of the programs in the book isn't working out like it should. Would this be the forum I use to get some advice on what I might be …

Member Avatar for Dave Sinkula
0
246
Member Avatar for Kazastankas

Now, in this particular one, I'm attempting to make a two-dimensional container that stores vectors. Of course, I wanted both dimensions to be dynamic at first, but once convinced that even attempting to do a 2D vector was nearly impossible or required a heap of used memory via the resize() …

Member Avatar for Kazastankas
0
178
Member Avatar for desidude

hi , Please take a moment to read this i am trying to write hexadecimal.cpp program for my C++ programming class but i dont know how to do it. the Project says as follows You have to design and implement a C++ program that reads numbers from a file,converts them …

Member Avatar for Kazastankas
0
265
Member Avatar for shahid

i write c++ program using template class that program take lenght and width of rectangle as integer, float and double and display the area and perimeter of rectangle. but my program does not run. please some one check this mention mistake or write this in a better way code: [code]//header …

Member Avatar for CrazyDieter
0
100
Member Avatar for paladin4service

Hi! I am new to this, and new to the programming. To be honest, it's not easy. I am having this problem with doing Complex numbers. Basically, I have to write a program to show the Amplitude and Phase of a Complex object. First, because Amplitudes are usually absolute values, …

Member Avatar for paladin4service
0
1K
Member Avatar for freemind

Hi to everybody! I'm writing a program that has to simulate a working system for deliveries of goods to some cities. I get several mistakes from the compiler while temporarly checking the code but they can't point me out the problem good enough.. Therefore I dare to bother you with …

Member Avatar for freemind
0
95
Member Avatar for tundeakins

dear programmer A pharmacy needs to automate drug inventory management system. Every drug has chemical Name, Chemical Composition, date of manufauturing, expiry date, and courtry of origin, quantity, category and others. the pharmacy has a policy to dispose expired drug before use. however, it is not an easy task to …

Member Avatar for Narue
0
162
Member Avatar for gluber

Hello.. it's me, again :mrgreen: sorry but I really need code for locking folder not a code for changing the attribut. :( 'cause i want to put my precious file in that folder :( so my friend can't steal it :evil: . Everybody in the world who can/want to help …

Member Avatar for Narue
0
197
Member Avatar for alone2005

if the token is separated by character like ':' or '|' how can you use sstream to tokenize it? << moderator edit: split thread from [thread=27724]here[/thread] >>

Member Avatar for alone2005
0
10K
Member Avatar for Savior

Hello there, i am new at C++ and i would like to learn a few thing if you could help me. I would like to learn how to load sounds on C++. I mean having the sound file on my computer and input it on the exe program i create …

Member Avatar for Savior
0
113
Member Avatar for bandm

Hi all! I am getting compile errors when it is Linking. --------------------Configuration: CIRCLE - Win32 Debug-------------------- Compiling... circle.cpp Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/CIRCLE.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. CIRCLE.exe - 2 error(s), 0 warning(s) [code]# include <iostream.h> class CCircle { …

Member Avatar for bandm
0
448
Member Avatar for desidude

i tried this #include <fstream> #include <iostream> #include <cstdlib> using namespace std; int main() { // Declare input stream ifstream fin; int min, max, val; int isFirst = true; fin.open("inFile.txt"); fin >> isFirst; min = isFirst; max = isFirst; while (fin >> val) { fin >> val; if (val < …

Member Avatar for desidude
0
225
Member Avatar for Asif_NSU

[CODE] string s; getline(ifile, s, '\n'); stringstream parser(s); string temp; while(parser>>temp) variables.push_back(temp); getline(ifile, s, '\n'); while(parser>>temp) terminals.push_back(temp);//Doesn't work the second time. [/CODE] stringstream can tokenize the string s only for the first time. The string s is passed to it through the constructor. How can reinitialize the stringstream object?

Member Avatar for Asif_NSU
0
924
Member Avatar for yaan

I need to have my code modified, but am unsure how to write the code to do it. After the ID and name are poped from the stack, I need the program to automatically display the list created i.e. I don't want to use display as an option. I think …

Member Avatar for Narue
0
100
Member Avatar for djbsabkcb

Below is my new code for this julian day program. I have fixed some of the errors I mentioned earlier. However, the day is still one short for the julian day and my conditional if statement seems to be the problem. I have tried a couple of ways to fix …

Member Avatar for zyruz
0
639
Member Avatar for logic321

Hi All, I am working on an assignment for this week, and once again could use your help in understanding concept. Basically, a company pays their salespeople on a commision basis, I need to write a program that uses a single-subscripted array to decide how many people are getting paid …

Member Avatar for Narue
0
393
Member Avatar for Kob0724

With school out and summer in full swing I decided to learn C++ in order to keep myself busy. I've been playing around and learning a lot. So far I've been able to make a program that solves quadratic equations! Alas, I've encountered a problem I can't figure out for …

Member Avatar for Narue
0
179
Member Avatar for dark7angelx07

Hi everyone, I'm having trouble with this program, I hope you can help me with it. I have to write a function that takes an integer value and returns the number with its digits reversed. This is what I have so far...... I will put a [U]*/*[/U] where i need …

Member Avatar for Narue
1
650
Member Avatar for shakoush2001

Hi Guys Ive been working on a project and it compiles and runs succesfully (in Borland BUilder 5.0). But when I try to run the excecutable outside the programming environment it gives me the following error: "This application has failed to start because BCBSMP50.BPL was not found. Re-installing the application …

Member Avatar for CrazyDieter
0
200
Member Avatar for somer2412

i am programming in Microsoft Visual c++ 6.0 and I have two linking errors that I do not know what they mean. Can someone please help. Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/Programming Project 1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.

Member Avatar for CrazyDieter
0
419
Member Avatar for shahid

please someone give me some idea to write this program Write a C++ program that has class 1) math Math class has only one data member number and member function display that will display the data member number. Write the constructor of your math class that will initialize the data …

Member Avatar for Dave Sinkula
0
163

The End.