49,761 Topics

Member Avatar for
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
362
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
266
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
110
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
228
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
967
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
231
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
643
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
266
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
127
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
314
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
112
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
105
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
243
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
243
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
162
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
261
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
97
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
92
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
157
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
195
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
110
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
439
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
917
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
96

The End.