49,761 Topics
| |
File is successfully opened 3 13 34 54 71 81 97 105 116 135 138 I have this data, and I want to call (3,1) then (3,13), then (3,34).......... How to declare 3 is the first than 13 is second? [code=C++] { ifstream stream1 ("STA83STU.txt"); if ( !stream1 ) { … | |
Hi! How can I get information from a public web page to my program? The page has, among other information, a field like "Share price: ###" that will be changing in time, and I want the program to get all the changes in its value. Anyone has any idea? Thanks … | |
I am trying to figure out how to modify this program so the file is read from the constructor: [CODE]#include <iostream> #include <string> #include <fstream> #include <vector> using namespace std; class Scramble { private: vector<string> _word; bool Check (string T, string S); public: Scramble(vector<string> words){ _word=words; } void Descramble (string … | |
How to make a pair programming.. like I have 1 2 3 4 5 6 7 First, I want to make a pair of 91,20 (1,3) (1,4) (1,5) using i=1, i<9,i++ | |
My program is required to build a binary search tree using integers inputted from a file. It also searches for items and counts the nodes accessed in each search. Also it needs to calculate the average number of comparisons per search. I am not sure where to insert the counts … | |
I had been out of school for about ten years and decided to return to college and major in programming. Good choice but I've been in over my head since day one. In any event I need help in accessing the text file then compairing user input with text files … | |
I use redhat enterprise 5 and I want to install mysql++, which used to connect to mysql from c++. I get the following error message when install checking for MySQL include directory... configure: error: Didn't find the MySQL include dir in '/usr/local/mysql/include /usr/local/mysql/include/include /usr/local/mysql/include/include/mysql' | |
I have a couple of sentences in an array. I need to randomly display 1 of them. How can I do this? | |
Consider the following two function prototypes: void Func1(int&, int&); int Func2(double, double); -I need help completing the following C++ user-defined function Func3 -which prompts and gets an integer for the variable Option from user. -Func1 should be called when the value of Option is 1, - Func2 should be called … | |
I am trying to create a DialogBox in C++ .NET with both an "OK" button and a "Cancel" Button. I know how to just show a MessageBox with an "OK" button like this: [code] MessageBox::Show(this, "Message"); [/code] | |
I have some sentences in a 2 dimensional char array. I need to change to first letter of each sentence to caps. I was thinking of removing the first char and placing it into 1 array and the rest of the sentence into another array. run toupper on the first … | |
has anyone got an idea on how to change letters on the keyboard around. i.e make Q on the keyboard print P on the screen. | |
I have some sentences that I want to print out the first character of each sentence. when I print it out I get the first character many times. here is the code. I just want the first character of each sentence printed out once per line. [code] int i; int … | |
Hello, I have a data structure which consists of 3 numbers. The data is later on saved in an array each time the user enters a new "izdelek". [code=c++] struct izdelek { double st_izdelka; double teza; double cena; }; [/code] later on, i have a function which should compare the … | |
Hi. (I am using Windows XP) I would like to know how you can use the function SetFileAttributes to hide a file or folder, I would also like to know about the declarations associated with this function. I would like to use this to develop a program that hides program … | |
/* I'm new on c ++ and i been strugling with this problem. create the special functions used by this routine and write the functions so it can be used by the main routine as shown*/ #include <stdio.h> #include <stdlib.h> void divideArgs(&parmA, &parmB); { int temp = *parmA; *parmA = … | |
/* I'm new on c ++ and i been strugling with this problem. create the special functions used by this routine and write the functions so it can be used by the main routine as shown*? #include <stdio.h> #include <stdlib.h> void swapArgs(int *parmA,int *parmB) { int temp = *parmA; *parmA … | |
I'm attempting to read lines of a file and store the contents of the line in an object. This is an example line (x,y,z co-ordinates) : [B]-12.852222 32.548111 -934.306681[/B] My problem is that my program is rounding these numbers up and I need absolute precision. Having read one line, storing … | |
So I have an assignment to write a program that calculates and prints the sum of the series for the following series: S = 1/(1*2) + 1/(2*3) + 1/(3*4) + ... + 1/(n*(n+1)) I know I basically need to loop and increment a variable till it equals n, but I … | |
| |
Ok so first off i dont know much about programming. I am currently in the middle of my first programming class in school and i love it. It is based around visual basic 6, however the class moves incredibly slow so i decided i want to teach myself another language. … | |
Following along a C tutorial, I entered this code. When I compile and run, it aks for my age, which I enter. But it doesn't display any of the 'if' or 'else' statements. So I hit enter and the window closes. Is there a trick or am I entering the … | |
Hi. BEFORE YOU THINK I AM JUST GETTING SOMEONE TO DO MY WORK, SCROLL DOWN AS I HAVE MADE A VERY GOOD ATTEMPT AND AM RECEIVING ERRORS! Basically i am fairly new to C++ and have been given a small class exercise to do for home work and am struggling … | |
Hello, Could you explain me why the first approach in the code above works and the second one fails? [CODE] #include <cstring> #include <algorithm> //char a[] = {'a', 'c', 'b', 'a', 'c', 'b', '\0'}; // Works char* a = "acbacb"; // Fails sort(a, a+strlen(a)); [/CODE] | |
I'm kind of teaching myself C++ from the ground up. I have previous programming experience in PHP, VB, Javascript, .net and i've done some other small stuff here and there but i've been putting off C++ for way too long and feel like I really need to learn it in-depth. … | |
After searching around this forum for a bit, I found getch() in conio.h, this very closely matches the type of function I am looking for, but I don't want it to wait for the user to enter a key (It would be nice if it would just return -1 or … | |
Hi, I want to create a simple exe(Without any supporting files...just a standalone exe) We dont have Matlab compiler I read in web that we can create exe in Matlab6.0,6.1 using C++ compiler. I have Matlab 7.1 and above. With the current Matlab version can we use C++ or C … | |
I have an equation within a while loop like this: [code] while(repeats != 1000000){ x = rand1; y = rand2; result = x + y; cout << result; repeats++; } [/code] Basically, 2 numbers are randomly generated, and are added together to put in the variable 'result'. What the above … | |
Hello, I've been having a problem with my arrays. The error that I am receiving says "[my array] undeclared (first use this function)" and "invalid types 'bool[int]' for array subscripts". My code has the following setup: [code=cplusplus] int array1[some size][some size]; int main(){ int array2[somesize];int array3[somesize][somesize]; int NUM; /*This number … | |
I have this data ROW 1: 3 15 36 56 71 83 97 106 118 135 138 ROW 2: 3 10 31 51 71 78 97 105 113 135 138 How to count when 3 meet 15 is 1 3 meet 36 is 1 3 56 is 1 3 meet … |
The End.