49,761 Topics

Member Avatar for
Member Avatar for Lilcrew

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 …

Member Avatar for mrnutty
0
136
Member Avatar for ichigo_cool

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 …

Member Avatar for mrnutty
0
546
Member Avatar for amirwan

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 ...........

Member Avatar for sami qaz
0
531
Member Avatar for dina154

[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 …

Member Avatar for dina154
0
2K
Member Avatar for Ravenn

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 …

Member Avatar for Ravenn
0
545
Member Avatar for jackmaverick1

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 …

Member Avatar for jackmaverick1
0
217
Member Avatar for Peter4n31

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 …

Member Avatar for Peter4n31
0
189
Member Avatar for shanker31
Member Avatar for eman 22
Member Avatar for m4ster_r0shi
0
583
Member Avatar for Labdabeta

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]

Member Avatar for Salem
0
166
Member Avatar for Buolbear4444

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?

Member Avatar for Ancient Dragon
0
178
Member Avatar for ztdep

I am using VS 2008 to creat a windows program, but ican not found the Message button. Could you please help me

Member Avatar for sergent
-2
97
Member Avatar for FriXionX

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 …

Member Avatar for FriXionX
0
116
Member Avatar for UltimateKnight

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. …

Member Avatar for UltimateKnight
0
100
Member Avatar for nocloud

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) …

Member Avatar for Schol-R-LEA
0
416
Member Avatar for SakuraPink

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 …

Member Avatar for SakuraPink
0
159
Member Avatar for henrimontreal

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 …

Member Avatar for VernonDozier
0
828
Member Avatar for akhal

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 …

Member Avatar for WaltP
0
56
Member Avatar for klikeras

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. …

Member Avatar for prvnkmr194
0
147
Member Avatar for paperstars

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, …

Member Avatar for paperstars
0
2K
Member Avatar for goody11

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: …

Member Avatar for goody11
0
276
Member Avatar for UltimateKnight

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.

Member Avatar for ichigo_cool
0
320
Member Avatar for SasseMan

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 …

Member Avatar for SasseMan
0
101
Member Avatar for akhal

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 …

Member Avatar for akhal
0
309
Member Avatar for king03

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 …

Member Avatar for MareoRaft
0
596
Member Avatar for montjoile

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 …

Member Avatar for rubberman
0
95
Member Avatar for tikoti

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] …

Member Avatar for tikoti
0
196
Member Avatar for rEhSi_123

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. …

Member Avatar for JasonHippy
0
337
Member Avatar for milan2011

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 …

Member Avatar for pseudorandom21
0
524
Member Avatar for yoni0505

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 …

Member Avatar for yoni0505
0
357

The End.