49,761 Topics

Member Avatar for
Member Avatar for alex55

Im inputting from a file to a 2d array and i dont know how to stop it once it gets to the end of the file the code i have for it so far is [CODE] for(int i=0; i<records; i++) { for(int j=0; j<month; j++) { inFile >> monthArray[i][j]; } …

Member Avatar for alex55
0
168
Member Avatar for HeartBalloon

I have to write a code to build an array like this: 1,6 1,0 2,3 3,4 5,6 4,5 7,6 1,2 9,7 Where the numbers are coordinates which have to be "separated" when taken in consideration Like: cell[2][2]---> x=5 y=6 I decided to make a char array, so that with atoi() …

Member Avatar for HeartBalloon
0
108
Member Avatar for akase2010

Your task is to write a main program which asks the user for an error value and then calls a function CalculatePi (error) which returns an approximate value of π. The function CalculatePi should use a loop to calculate the above series (*). It should keep two values, currentApproximation and …

Member Avatar for pseudorandom21
-6
110
Member Avatar for wildplace

[url]http://i54.tinypic.com/4zymi0.jpg[/url] can someone please explain how does the sizeof() and the mask help me on converting from dec to binary? and also bit shift? this what i got now: i followed the book says to bit-wise & the mask and my input; but the mask is ending with 0s(0x80000). isnt …

Member Avatar for wildplace
0
74
Member Avatar for akase2010

Im new to c++ and this is our first assignment. I dont even know where to start. Help! Your task is to write a main program which asks the user for an error value and then calls a function CalculatePi (error) which returns an approximate value of π. The function …

Member Avatar for VernonDozier
-1
167
Member Avatar for Mayank23
Member Avatar for alexchen

What is the difference between using system("pause") and cin.get(pause)? [URL="http://www.daniweb.com/forums/post1446085.html#post1446085"]Oliver [/URL]told me never use system("pause"). [code] #include<string> #include<iostream> int main(){ using namespace std; string str = "My name is shridhar"; cout<<"What is your name"<<str; char pause = 0; cout << "Press enter to continue..."; cin.get(pause); } [/code]

Member Avatar for VernonDozier
0
346
Member Avatar for realproskater

/*I have to write code for the Game of Life. I wrote nearly all the code for it but for some reason when I run my second generation it just displays the same one as before. Here is my code any idea on why this is happening would be greatly …

Member Avatar for alexchen
0
6K
Member Avatar for vbx_wx

With witch header do you use this function ? I tried winsock2.h, ws2tcpip.h with no luck. Any help please ?

0
111
Member Avatar for spetro3387

Hi everyone, I am working on a 3D viewer using libQGLViewer. In all of the examples provided, the main function looks something like this: [CODE] int main(int argc, char** argv){ QApplication application(argc, argv); Viewer viewer; #if QT_VERSION < 0x040000 application.setMainWidget(&viewer); #else viewer.setWindowTitle("pointCloud"); #endif viewer.show(); return(g_qApplication.exec()); //waits for Esc } [/CODE] …

Member Avatar for spetro3387
0
156
Member Avatar for triumphost

Hi Everyone, Im using visual studio 2010 windows form application. I created a windows form application to add and remove files to a directory on the click of the button1. The problem is that when I put it on a different computer, it can never find those files.. Its supposed …

Member Avatar for triumphost
0
183
Member Avatar for canadiancoder

Hi Folks, This quandary should be fairly straight forward but I have yet to find an example that works. Essentially I have a struct, I create an array of these structs in C#, pass the array to C++, do some manipulation on the C++ side and return the results to …

Member Avatar for canadiancoder
0
1K
Member Avatar for dynamyt3

I have this code : [CODE]void __fastcall TForm1::DrawGrid1SelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect) { int temp,tempR=0, tempC=0, r=0, c=0; bool empty = false; CanSelect = false; //checking for empty cell - up if (ARow > 0){ if (MyArray [ARow-1][ACol]==11){ tempR = ARow-1; tempC = ACol; empty = true; …

Member Avatar for chrjs
0
156
Member Avatar for emreozpalamutcu
Member Avatar for jonsca
0
107
Member Avatar for justice igwe

well am using the turbo c++ compiler , so you must convert it to cpp ( c++) before u can use it ok. here we go. steps: (1)press the windows shortcut key and hold R or go click on RUN (2) type in the following( C:/TC/BIN/TC.EXE) hit ENTER, wait for …

Member Avatar for justiceigwe
-3
374
Member Avatar for Rookie09

Sup guys, I got another "little" thing here , i am trying to create a preprocessor macros for SQL language , so when the compiler run into things like SQL key words : for example : COLUMN(title) TYPE(string), COLUMN(author) TYPE(string), COLUMN(copies) TYPE(int), it automatically will generate appropriate C++ code ( …

Member Avatar for Mpampirina
0
199
Member Avatar for lara_

i dunno whether this question has been ask before but i've try to search but didn't found. so i ask it here... very simple... if i declare [B]int Z; cin >> Z;[/b] if I enter integer, it works fine but i enter character it's looping. :sad: how to prevent it …

Member Avatar for Hymppis
0
337
Member Avatar for trafficmash

Hello i need help with writing a small pseudo code for my subject Programming methods i could not attend classes because i was hit by floods and my deadline is in 3 days please email me at[I] <<snip>>[/I] if u can help Any help is appreciated Thanks

Member Avatar for elsiekins
-2
70
Member Avatar for ktsangop

Hi everyone! Just wanted to ask before i begin messing around. Is it possible for two processes to access the parallel port simultaneously? So that if i short circuit Input pins to output pins of the parallel port one process will provide input to another one? I am using Windows …

Member Avatar for ktsangop
0
210
Member Avatar for TinhornAdeniyi

i am trying to move the node in the first item from the list and add it to the back of the list 1->2->3 becames 2->3->1 instead i get 3 1 2 [CODE] #include <iostream> using namespace std; struct nodeType { int info; nodeType *link; }; void createList(nodeType*& first, nodeType*& …

Member Avatar for TinhornAdeniyi
0
198
Member Avatar for kocmohabt33

First of all, I'm new to Daniweb and I would like to thank in advance to all those who take their precious time to help me. I appreciate it greatly. Hopefully, I'll get good enough to contribute and help others in the Daniweb developing community, as well. The problem I'm …

Member Avatar for kocmohabt33
0
140
Member Avatar for biancaW

I need help to create C++ program for this question Input the price of a product and the tax code (R or L).If the code is ‘R’ the tax rate is 8% and the rate is 12% for ‘L’. Calculate the total price and tax paid for the product. Continue …

Member Avatar for arkoenig
0
283
Member Avatar for butchoy

[ICODE]#include<iostream> #include<conio.h> #define height 10 using std::cout; using std::cin; using std::endl; int main () { //int num=0; int n,m,width; int count = 0; int nums[count]; int div=0; cout<<"Enter the number you wish to enter: "; cin>>width; int jologs [height][width]; cout<<endl<<width<<endl; for (int i=0, m=width; i < width; m--,i++) { cout<<endl<<endl<<"Number(s) …

Member Avatar for butchoy
0
190
Member Avatar for emreozpalamutcu

I'm making a program and in one of the part of the program there is this button and for it to do main function it needs to check if the notepad is running. So how can i check if the process is running?

Member Avatar for cool_zephyr
0
8K
Member Avatar for daniel1977

Greetings Friends: I am stuck with a compilation error that I have not been able to resolve. I was able to duplicate this error with a test program so whatever I am doing (or not doing), it is the same. Please see the code below. The error is actually from …

Member Avatar for mike_2000_17
0
128
Member Avatar for kylej628

Hello everyone, I am trying to loop the entire "main" function, yet for some reason it only loops the termlength_determine() function and then jumps to the 'askloop_function'. i only need it to loop the entire 'main' function [CODE] //This program calculates the user's pay. #include <iostream> using namespace std; //::integer …

Member Avatar for sfuo
0
122
Member Avatar for Nandomo

I am writing a program which asks the user for input, how many digits to use, on 2 numbers which will multiply themselves. A loop will multiply all combinations of that number digits and determine the largest palindrome. I know how to do palidnromes with strings, but don't know if …

Member Avatar for Nandomo
0
114
Member Avatar for tomtetlaw

I've been following Chad Vernon's (very good) Direct X 9 tutorial [[URL="http://www.chadvernon.com/blog/resources/directx9/loading-a-static-mesh-x-format/"]http://www.chadvernon.com/blog/resources/directx9/loading-a-static-mesh-x-format/[/URL]]. I am stuck at one point because I'm trying to load a .x model, I have it set up so it will output errors if something goes wrong but nothing appears, I've setup breakpoints and looked at return …

Member Avatar for chrjs
0
241
Member Avatar for lgonzo

am newb in c++ trying to write simple c++ program that a computer, try to guess a number i have chosen by it producing rand number and me telling me whether it is to low, high, or right and using do while loops we are suppose to produce it now …

Member Avatar for lgonzo
0
2K
Member Avatar for Xtian9

I am investigating the equations which say that the error in the trapezium rule is proportional to (b-a)^3, where a and b are the lower and upper limits respectively, and that the error in the simpson's rule is proportional to (b-a)^5. [img]http://img809.imageshack.us/i/eqns.png/[/img] (First equation is for trapezium, second equation is …

Member Avatar for mike_2000_17
0
421

The End.