49,761 Topics
| |
I need to create a rectangle using for loop and a nested for loop So far the code I've got is: [code]#include<iostream> using namespace std; int main() { int row, i, width, spaces; cout <<"Enter the number of rows: "; cin >> row; cout <<"Enter the rectangle width: "; cin … | |
Okay I'm damn fed up with this problem ever since I've been trying to organize a bunch of global variables and functions. I'm organizing the variable/function declarations in a header file and defining them in a separate cpp file. So, Globals.h and Globals.cpp.. I then try and link this both … | |
hi,can any one give me a good documentation about the library dos.h functions and registers which explain it in a good way to understand. for example function intr86x(),int86(), and structures REGS and SREGS ........... | |
[CODE]// Randam Guessing Game #include <iostream> #define NEWLINE "\n\n\n" #include <cstdlib> // need to use rand() function #include <ctime> using namespace std; /*void Start(); void GetResult(); void HighScore(); int a, b, chance, maxrand; char difficultychoice, menuchoice, diffchoice; void Start() { a = 0; b = 0; chance = 0; maxrand … | |
hi, i put together this code to read a text file line by line, split the resulting string into the 4 values and send these values to four text-boxes. during each cycle of that while loop it's suppose to initialize the backgroundworker_dowork, which will read the values and use them(and … | |
Hi! I've been making a rather large (but not huge, by any means) program and it needs, or so I think, a couple of classes and I want them to use inheritance to make my life easier. However, when I try to include all of my files in the main … | |
I am quite desperate about a random crash. The memory could not be "read" error. I would be very happy for any help. Thank you. [CODE]HRESULT CSceneNode::UpdateAll() { D3DXMATRIX backup_local_tm = ei.world_tm; Update(); SceneNodeIterator begin=FirstChild(); SceneNodeIterator end=LastChild(); for (;begin!=end;begin++) { (*begin)->UpdateAll(); // Here is the random Crash !!! } ei.world_tm … | |
how can I convert a variable of type template to an integer?? | |
I just observed an unusual phenomena in my code. I am wondering if anyone can explain it. [CODE]void dofunc(int a, int b){a+=b;} void foo(int near,int far){dofunc(near,far);}//Syntax error, expected primary expression before , and ) void poo(int vnear,int vfar){dofunc(vnear,vfar);}//Compiles fine?[/CODE] | |
I can't find the C/C++ drop down menu. I know it's basic, but how do you change it? Was there some kind of update? | |
I am using VS 2008 to creat a windows program, but ican not found the Message button. Could you please help me | |
So, I joined DaniWeb in february, and posted a problem regarding this code. I then quit learning for a while, and started again a week ago or so, continuing this. I've made it better, and its almost working, except for the If statement doesnt work. It asks you what you … | |
I am using Microsoft Visual C++ Express 2008 edition and notice some code is not working in here. There are different functions and some headers are not recognized while in other are. So is the compiler not good? I've heard about Dev C++ and Turbo C++ but haven't tried them. … | |
I have a number of functions I would like to reuse in multiple pieces of code. I have put these into a single header file that looks something like the following: [CODE] #ifndef FUNCTIONS_H #define FUNCTIONS_H //function prototypes extern float sum(vector<float> &v); //calculate sum of a vector float sum(vector<float> &v) … | |
Hi all, I am working on a data file that looks like the following: [CODE]value1: 0.7586 +/- 0.00473 value2: 0.664901 +/- 0.0357 value3: 0.662784 +/- 0.00447 ------------------------------------------------------------------------------------------------------------------------- value1: 0.765217 +/- 0.00425 value2: 0.694663 +/- 0.0277 value3: 0.66438 +/- 0.00393 ------------------------------------------------------------------------------------------------------------------------- value1: 0.758317 +/- 0.00332 value2: 0.648057 +/- 0.0201 value3: 0.660746 … | |
Hi guys, Actually I have a problem to use two classes at the same time. For example when I increment the number of winnings at the function of the 2nd class and want to show the result at one of the functions at the first class. the variable I used … | |
Hej Its too simple looking but I need c++ code to round off any floating point number to the nearest 1000th. I read somewhere to do it like this: [code] double number = cos(theta); double rounded_1000th = floor((x*1000.0 + 0.5)/1000.0); [/code] But this solution fails for numbers less than zero … | |
Hello, I need help with an assignment, been trying to figure it out for couple of hours with no luck, hope someone here can help me, i would be extremely grateful. I need to create a 2D array 5x4, each row represent a student and each column respresents a subject. … | |
Hi, I'm new to C++, I'm trying to write a program to compute the sine series for taylor expansion. I've written two codes, but both do not work after a certain point. (The sine series is: sin x = x - (x^3/3!) + (x^5/5)...etc.) With the code below, when x=1.5, … | |
Hello, I'm trying to write a vector that has a list of installed program names to a text file. When I go to do this, the program shows the names of the installed applications, but in the text file it just repeats the number 52428. Any ideas? Here's the code: … | |
Hey all. When you have the whole program running, and is executed it's running at the black console window. How are the programs made so that they run with GUI interface and stuff like that? Are they exported differently and where are the images and things put together ? Thanks. | |
Hello all! I'm having problems with running c++ on iOS. I have a iOS openGL project in Xcode 4 and an external library written in c++ that has to be a dependency to the iOS target so it can run on an Ipad. right now I'm testing with the iPad … | |
Hi I am working on fast fourier transform where I have to use std::complex<> template class types. I have a situation where I want to calculate nth roots of unity as follows w = pow(e, 2*pi*j/n) Where e is eulers constant, and j=sqrt(-1.0); But this doesnt work for me as … | |
Hi there guys I need some help I am creating an inventory with loads of exception handlers, I got a problem with isalpha and isdigit because supposedly it will detect whether an input is a char or a digit... Ok I tested a simple program to show my problem. I … | |
Hi, I have the structure and the insertion method of a btree, but I need to do the traversal method. I have this so far: [CODE]void inorden(btree r){ //inorder for (int i=0; i<=r->peso; i++){ //n+1 branches if (r->rama[i]) inorden(r->rama[i]); if (i<=r->peso-1 && (r)->clave[i]) printf(" %i", r->clave[i]); } }[/CODE] The problem … | |
Hi all! I've read forward declaration is much prefered than include in header files mainly because it reduces the compilation time. Other reasons? My particular situation is that all header files that I use are within a namespace. I've seen two different ways for forward declaration in this case: [CODE] … | |
Hi Guys, I am working on converting a console application into a user friendly GUI. The actual application is written in visual C++ and person has no information none what so ever on how to run it. So to understand the technique I am trying to experiment with the application. … | |
Hi, I am trying to make a bank application that has two interfaces.One is the employee interface that lets employees to create an account and assign a IDnumber to each account(lets say the bank only accepts 100 accounts) and a balance for each account. The employee can also close an … | |
| I had a problem with some program I wrote that edit specific values within a specific file. When I saved the values, using fstream's write() function, everything between these values became null. I've looked again in the I/O tutorial - [URL="http://www.cplusplus.com/doc/tutorial/files/"]http://www.cplusplus.com/doc/tutorial/files/[/URL] and saw that they use memory block at the … |
The End.