49,761 Topics
| |
[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] | |
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 … | |
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> # … | |
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 ; … | |
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 … | |
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() … | |
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: … | |
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 … | |
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 … | |
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: … | |
Is there an API to view all running processes? Thanks | |
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 | |
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 … | |
Any clean way to get from one to the other? erase() has been pretty vexing for me. | |
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; … | |
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 … | |
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 … | |
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() … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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] >> | |
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 … | |
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 { … | |
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 < … | |
[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? | |
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 … |
The End.