49,761 Topics
| |
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]; } … | |
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() … | |
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 … | |
[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 … | |
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 … | |
how can i use a string in a switch statement? | |
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] | |
/*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 … | |
With witch header do you use this function ? I tried winsock2.h, ws2tcpip.h with no luck. Any help please ? | |
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] … | |
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 … | |
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 … | |
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; … | |
[CODE]if (progressBar1->Value == 2000; { label1->Text = "Hello"; }[/CODE] | |
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 … | |
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 ( … | |
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 … | |
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 | |
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 … | |
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*& … | |
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 … | |
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 … | |
[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) … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.