49,761 Topics
| |
My code works fine for smaller integers, but when it gets over 1 million or so the number changes or goes negative. I am sure this has to do with the range of int, but I tried float and double and all the numbers came out the same...... What is … | |
Hey Guys, I had a question earlier about some bounds and i've got it all figured out after some intense debugging and some help. I just have one more simple question and I think I should finally be on my way. If I have a recursive function that returns an … | |
Hi I'm doing an assignment on Rational Number calculations. I'm getting some compiling errors which I don't know how to fix. Here is the error message and the code is beneath the error message. I would really appreciate if someone could read over this and see if you know whats … | |
Hi, I am trying to make a word counter, for that I have to input a string line untill '@@@' character is entered. My problem is that when I enter "Hello hello" as my input it reads the last hello twice.. or this is what I think it does.. Right … | |
I'm working on a program for my C++ class. The assignment uses a file that includes student names and three test scores. For example: Name Test1 Test2 Test3 Name Test1 Test2 Test3 My teacher wrote the main part of the program for us and we are to write the functions. … | |
Hey guys, i'm working on a recursive problem that invlolves getting from a place "s" (start) to a part "e" (end) in as few moves as possible. There are road blocks "x" and the grid is a size up to 15x15. My problem is that when I try to write … | |
Write a function that accepts an array of integers and determines the difference between the integers. For example, if the array [3 7 8 13 11] is passed to the function, it prints to the screen [3 4 1 5 -2]. mine give me : 3, 4 ,4 9, 2 … | |
So I have a data file that looks like this [CODE] Movie1 Year Salary Actor1, Actor2 Movie2 Year Salary Actor3, Actor4, Actor5 ... etc [/CODE] The part that's throwing me off is the actors line. It can have from 1 to 5 actors on it, separated by commas. I have … | |
I am learning C++. This class project was to write a program that will let you enter a diver's first and last name and city. Also 5 judges results along with the difficulty for the course. Then display the results. It is suppose to ask if you want to enter … | |
hello, i need a tool to measure the cyclomatic complexity of a given C source file. what do you suggest for this? thanks.. | |
I am having trouble with my quicksort. When I run my program it sorts them once( the lower half of the numbers are on one side, the higher half on the other). How can I get it to sort again without using a recursive function. [CODE] void qs::quicksort(int set[], int … | |
I'm trying to create a print void function, however I'm not understanding how to call the database in the print function. I've tried to do something similar to what is in my textbook but all I'm getting is errors. This is what I've done so far. [CODE] #include <iomanip> #include … | |
Hi, Thank you for helping and here is the problem: [ICODE] #include <string> #include <fstream> #include <vector> #include <iostream> using std::string; using std::ifstream; template<class t> class Openfile { private: string pavadinimas; ifstream fin; public: typedef ifstream & reference; Openfile(); Openfile(const char * c); reference rout(); std::vector<t> & operator>>(std::vector<t> &); ~Openfile(); … | |
Write the function my_strncat(). The function has three parameters: a char * s1, a const char * s2, and an int max, which represents the maximum size of the s1 buffer. Append the characters in s2 to the end of s1. Make sure you have only one '\0' at the … | |
Hello all: I am working on a class for creating 2-D arrays. A couple of days ago, someone kindly helped me identify a problem with my operator() expression, but now I'm getting a segmentation fault. I just can't figure out where the problem is! If anyone could take a look … | |
Hello, I'm completely newbie, I used pairs from <utylity>, but now I'm in need of something like "thirds", so I decided to create a template. I started with: [CODE]template <class T1, class T2, class T3> struct thirds { typedef T1 first_type; typedef T2 second_type; typedef T3 third_type; T1 first; T2 … | |
Hey guys i need help with my program. What I need to do is to open to inout files. one containing the accout numbers with there names and balance. the second is the transactin history with accout num ie 123 d45.67 d 56.78 w 78.99. My problem is that i … | |
How gdb gets connected to the live boxes and it provides exception if happens? | |
I'm working on a program to convert decimal to binary, octal and hexadecimal. I can get the code correct to convert decimal to binary and octal, but in reverse. I was 'given' the code to use for STACK class to push and pop o reverse teh order, but I'm having … | |
Hi, I'm making three bank account classes but this is just the basic one. I am having trouble with the withdraw function, mainly due to me not understanding how to correctly use the friend method when it come to overloading operators. Any help explaining how to correctly use it in … | |
Number is always represented with the closest double? A real number is usually between two double representation. Always the closest representation is used or not necessary? | |
line 121 (p = j) calls both assignment operator and copy constructor functions. is this normal? also the destructor is called three times. I thought the function should have been called two times. [CODE=c] #include <iostream> #include <string> using namespace std; class Student{ private: //A string that stores the name … | |
First, thanks for any replies that I'll receive. I'm currently trying to create a simple 1 player(comp vs player) poker game(simple as in minor game errors are allowed). After I initialize the deck, I shuffle the deck then deal the cards. After dealing the cards, I set the cards for … | |
I need t o make these paterns [code] * * ********** ********** ** ** ********* ********* *** *** ******** ******** **** **** ******* ******* ***** ***** ****** ****** ****** ****** ***** ***** ******* ******* **** **** ******** ******** *** *** ********* ********* ** ** ********** ********** * * [/code] I … | |
| Friends,i need your advice.i cant find a good program to use and work on C++.At the moment i am using Borland C++ Builder 6,but i also have Microsoft Visual C++ 2o1o.What will u advice?:( |
Anybody know a good Data Structure Book? | |
I cannot reproduce numeric_limits<double>::epsilon() I have tried the following code: [CODE] #include <iostream> #include <limits> using namespace std; int main() { double x = 1; double s = 0; for(double y = x; y == x; y = x+(s+=x*1e-20)) {} cout << "my calculation: " << s << endl; cout … | |
Ok... Here is the problem.. [B]Void extract_data[/B] is used to choose number of paramets I want to extract from Active directory... For exmaple...I choose SAMID, Telephone Number, Manager name...But number of functions may vary...from one to all shown in the menu... [B]Void extract_data2()[/B] is used to use all data gathered … | |
Hello, How do i resize/stretch the image inside a pictureBox(win32 form)? i was only managed to resize/stretch the border of the pictureBox, but i want to resize/stretch the image itself, how do i do it?. Thank you in advanced. | |
Write the function my_strchr(). The function has two parameters: a const char * s pointing to the first character in a C-style string, and a char c. Return a pointer to the first appearance of c appearing inside s and NULL (0) if c does not appear inside s. Is … |
The End.