51,593 Topics
![]() | |
Hi, I am new to OOP and I have ended up in a situation that might force me to abondon some of the flexibility I had in mind in my project. Before I do so, I figure I'd ask here to see if there is an easier fix for me. … | |
I am confused on how to implement the copy constructor, operators and a destructor given different contexts I have a vector(int size_=0, double = 0); constructor from a given vector class and I have to implement the copy constructor: vector(const Vector&) The copy constructor needs to make a deep copy … | |
Hi,:) I'm now doing a project on c# sql project.I have a database problem,:'( when a user gives the input dynamically through the front end ,the user data can be view through data grid view .but it is not getting stored in the original database.I have tried a lot to … | |
Hello I have a program I am trying to make which takes in a word pattern (eg; d?ll, h?l?o, go?dby? etc) & searches an 'array containing different words' to find any words in the array that match the input word pattern. So for example; if I input 'd?ll', the program … | |
Hi, I was wondering how you could change the head bar of a window in windows API. This is the line of code that I want it to change: CAPTION "Spanish Conjugation Quiz" | |
I've been trying to compile several C++ tutorial files that include the standard Microsoft header files, such as 'windows.h' to create a basic window. I'm fairly new to this C++ business, but I have a bit of experience with writing console applications on C. The problem is that the command … | |
I'm trying to load a bit map but the picture won't come up. It compiles just fine. I'm not sure if this makes a difference either but I am trying to load a bitmap into a dialog box. Here's the code: The .cpp file: #include "windows.h" #include "resource.h" HBITMAP g_hbmHang … | |
Hello! I want to use static_cast<int> on a void* member Variable in another class. (class aMessage). aMessage class has a public variable void* pVar. While using static_cast on a local variable is running smoothly, I get a compiler error trying to cast it on the aMessage->pVar. pVar is being declared … | |
# include <iostream> using namespace std; int main () { int arr[100], num, sum=0, size=0; cout<<"Enter an integer: "; cin>>num; if (num < 0) num*=-1; while (num != -999 && size < 100) { arr[size]=num; size++; cin>>num; for (int j=1; j<size; j++) { for (int i=0; i<size-1; i++) { if … | |
How do I call a function that gets passed as a paramater? like this: and how do i store it as a variable? [code=c++] void a_func(void(*func)(void)) { //how do i call func? //this gives me an error: func(); //is this hwo to store the function as a var?-> void* this_func … | |
Hello I need some tips regarding line striping i.e, number of lines joining with the indices and vertices in GUI using c++. | |
For Input 4 15.01 15 3 3.01 The value of 'avg' is becoming 9.00. I don't understand why this should be 9.01. Please help. [CODE] #include<stdio.h> #include<math.h> double round(double x) { return floor(x * pow(10.0,2.0) + 0.5)/pow(10.0,2.0); } int main() { //freopen("10137.txt","r",stdin); //freopen("out1.txt","w",stdout); long i,n; double sum,avg,sum1,a[1005]; while(scanf("%ld",&n) == 1 … | |
hi all, i am very new to programing and i have just writen a calculator for measuring building marerials, the program works great, but it dosn't look to pretty. how can i get my calculator to work in a window, instead of the default dev c++ command window thingy i … | |
Hi I want to play a sound using directsound. As you can see i'm stuck already. [CODE] #include <dsound.h> #include <iostream> using namespace std; int main(void) {//CREATE OBJECT LPDIRECTSOUND8 ppDS8; HRESULT hr = DirectSoundCreate8(NULL, ppDS8 ,NULL); cout << hr; Sleep(2000); }[/CODE] I get the following error: 1>.\main.cpp(9) : error C2664: … | |
Hey, I'm working on a Spanish program and I want to make it so that if somebody wants to type in an a with an accent all they have to do is press the pushbutton. I realize how to create the pushbutton but I don't know how to just insert … | |
Hey i have a problem about file copying. I have a source file opened with fstream and a destination file opened with FILE*...im trying to copy a chunk of the source file into the destination (the function receives as parameters the start second on the source file in which we … | |
I am working with TWordApplication that ships with Borland Builder6. I don't seem to convert to C++ successfully from MSDN examples. I manage to open word from my app and paste text from the clipboard. I have used Select() to select the entire document, but can't work out how to … | |
[code]#include<iostream.h> #include<conio.h> class A { int a[10]; char name[10]; public: void read(); void display(); }; void A::read() { cout<<"enter rno name"; for(int i=0;i<3;i++) { cin>>a[i]; cin>>name; //cin>>a[i]; } } void A::display() { //cout<<count; for(int i=0;i<3;i++) cout<<a[i]<<name; } //int A::count; main() { clrscr(); A x; x.read(); x.display(); getch(); }[/code] here i … | |
Hey, I can't figure what is wrong with this part of my program. I know that it has something to do with that my variable i is exceeding the vector boundaries but I can't figure out how to stop it. I try to make the program exit before the vector … | |
Hello! I am having a problem with my program.I have made a program that prints the four different shapes one after the other. But the program should print these four different shapes side by side. I know there should be one outer loop for this but I am unable to … | |
Greetings All, I was wondering about how a build process goes on in Vc++. I want to know that is there any intermediate assembly file generated while building a source file as what happens with gcc. If the answer is no ,then why gcc build process has this ones step … | |
I 'm making a game in C++ and I need some help, I want to display a bmp image. I want to read a a bmp file and save the color ids in a matrix. Could you please help me. :) | |
Hi, Look I'm new to C# and I have a working knowledge of VB .Net. I would like to learn C# but I'm having a problem. It's probably a basic problem but, for a console program how to I check what someone has typed in so that the console can … | |
Hi, I've got problem with method ignore from cin. This is my code: [code=cplusplus] void _name() { string name; char ch = 0; bool name_accepted = false; cout << "Enter your name: " << endl; while (!name_accepted) { while (ch = cin.get()) { //cin. if (isalnum(ch) || isspace(ch) || ispunct(ch)) … | |
Can anyone help me to program standard deviation? Here is the instructions for this program: Write a program that takes as input five integers and outputs the mean and standard deviation of the numbers. If the numbers are val1, val2, val3, val4 and val5, the mean = (val1 + val2 … | |
I need help to sort this numbers, but the problem is it won't like i want it to be with the decimals. I tried changing the int to double but then the program will not run. Here is the code, please provide feedback. [code=cplusplus]#include<iostream> using namespace std; // function prototypes … | |
Currently I have 2 applications that reside on the same system (local applications) that need to communicate. One is a C++ program that already uses mailslots to communicate with other system (remote) and the other is a new C# service I have just written. Given that the C++ application is … | |
Hello. Currently I'm making a game in C++, its not my first game (Examples of what I've made is "The game of life" in both 3d and 2d, TicTacToe with my own AI algorithms (based on the graph theory), 2D Paratrooper game), however its my first programm that requires allot … | |
c++: Why the member functions of one class can access to private data member of other object? I use vs2008 and g++ compiler. the codes are list below: [CODE=c++] #include <iostream> using namespace std; class Integer { int i; public: Integer(int ii) : i(ii) {} const Integer operator+(const Integer& rv) … | |
could any one please help me to solve this error? error LNK2019: unresolved external symbol _Underst_Sql referenced in function _main 1>cartmot.obj : error LNK2019: unresolved external symbol _Read_Desc referenced in function _main 1>cartmot.obj : error LNK2019: unresolved external symbol _Assegna referenced in function _main fatal error LNK1120: 3 unresolved externals … | |
"return type may not be specified on a constructor" I am getting this error in VS10. Here's my code: (the error appears on the word class) ComplexNumDec.h [CODE][COLOR="Red"]class[/COLOR] ComplexNum{ private: double real; double imag; public: ComplexNum(double x, double y); ~ComplexNum(); ComplexNum operator+(ComplexNum x); ComplexNum operator-(ComplexNum x); ComplexNum operator*(ComplexNum x); }[/CODE] … | |
Ok, so i've made a bootloader in assembly but I think its very hard to write the operating system (the kernel) in assembly so I wonder if it is possible to write it in C#? The question is: Can you write a C# console application and convert it to .bin … | |
hello. I need help implementing an SSE2-accelerated MD4 implementation. I found one that I think may work at [URL="http://www.freerainbowtables.com/phpBB3/viewtopic.php?f=6&t=904&start=30"]http://www.freerainbowtables.com/phpBB3/viewtopic.php?f=6&t=904&start=30[/URL] it is the post by Corni: [QUOTE]“So, I took a crashcourse in how to implement MD4 and in what the hell is SSE2 and how do you use it, and implemented … | |
Hi. I have a c++ game where you make money throughout the game, and the game saves it to a separate txt file. When the game opens back up, it grabs the info in that txt file and puts it into a variable. Thats not the problem though. I'm adding … | |
Hello I need a database 1)I need easily to find a minimal value in the database 2)I want to easily add and remove values(well its trivial I know) I tried to use STL map but I couldn't find an easy way to implement the first requirement. Thank you in advance | |
How do I read two different data types from a .dat or .txt file? For instance I have a file that is an inventory file that shows the item reference number, the item name, and the quantity available. Example of what the file may look like: 01 Textbook 54 02 … | |
[TEX]Please help me about my project "Array Alphabet"[/TEX] this is the example output: a b c b c d e d c d e f g f e d e f g h i h g f e * I don't know how to start the program. Give me ideas. … | |
Ive been working on this poker program for a while now and ive tried several different ways to make a poker game...i have to make it using very basic c++ ...ill try to post what i already have done | |
I'm supposed to write a function that takes an input, and then outputs a set number of digits based on an array. The code I have works for the numbers 1-10, but anything above that messes up because it goes on to a value that doesn't exist in the array. … | |
Hi guys, I'm just starting out and I'm having a little problem. When I run an application, it closes by itself right away. A few days ago I went to the Local Library and picked out "Sam's Teach Yourself C++ in 24hrs - I know it's a lie" It came … | |
I am extracting information from SQL and writing reports. This [I]should[/I] (I hate that word) be easy... but : All is fine as long as the formatted text fits on one page. However, if the report becomes more involved (more data in SQL) more than one page is required. I'm … | |
I need help to write this program. Create a data file that contains 15 integers, some positive and some negative. You may create the file in Notepad or any other text editor software. Save the file to the same folder your program will be in. Write a program that reads … | |
Please help, this is for an assignment I need to turn in and I'm STUCK! I have no idea how to do this I've done programs but none like this calling differnt functions. this is what is in the data file. 100 Hammer 10 20 10 200 Saw 24 00 … | |
Hello! I am having a problem in this program.In it a have to calculate the value of π from the infinite series π=4-4/3+4/5-4/7+4/9-4/11+..... by using this formula i have to print a table that shows the approximate value of π after each of the first 1,000 terms of this series. … | |
Hi all, I am having trouble in finding out how to point to a private member variable. E.g. : [CODE] #include <iostream> using namespace std; class Angry_Dude { private: int health; int attack; } [/CODE] I want to point to the address of health. I know about the homework policy, … | |
Hey, I was working on a program that would ask you a question and you had to put an answer. Well, when I went to compare the answer the user inputs with the right answer, it always comes up wrong and I was wondering if I did these lines of … | |
Hi all, I want the program below to calculate the doctor fee. I am doing it to learn class and inheritance concept. "[B]patient1.output(cout);[/B]" works correctly it gets [B]doctor_hour_fee[/B] from [B]doct1[/B] object. The problem is at [B]patient2.output(cout);[/B]. When I enter patient information it asks me to enter all member variables of … | |
Hello! I am having a problem with my program.I have to write a program that find all pythagorean triples for side1, side2 and hypotenuse all no longer than 500. I have to use a triple-nested for loop that tries all posibilities. I know that the sum of squares to two … |
The End.