51,593 Topics
![]() | |
my program is [ICODE] class stack { protected: int tos; int store[10]; stack() { tos = 0; } public: void push(int x); int pop(); }; void stack::push(int x) { cout<<"put the values into stack"; store[tos++] = x; } int stack::pop() { cout<<" get the values from stack "; return store[--tos]; … | |
Hi!, i'm writing from Argentina. I need your help! I'm doing a project for the university and i have to make a Restaurant management. Well that´s not the problem. I have to log into the software, so i need to read from a file that have the user and password. … | |
Hi, I am currently working on a homework assignment with the topic being a boggle game. We are creating the boggleboard class and one of the function that must be included is this: bool playWord (string word, string player) This method returns false if word does not appear in the … | |
Hi im trying to make a packet filter in C++. The only point of it is to drop all packets sent and recieved, or allow all packets sent and recieved. And I need it to turn on and off by pressing F9. Can someone help me on maybe how to … | |
This is the problem I need to solve. It comes directly out of a C++ Programming book: [QUOTE]A right triangle can have sides that are all integers. A set of three integer values for the sides of a right triangle is called a Pythagorean triple. These three sides must satisfy … | |
how to create a dynamic string array to store string items using new ... | |
Make a program so that the function main is merely a collection of function calls. Your program should use the following functions. a. Function openFiles: This function opens the input and out files, and sets the output of the floating point numbers to two decimal places in a fixed decimal … | |
Its an exact change program but the output is not right. I don't know whats wrong in it. Can somebody please help me with program. #include <iostream> using namespace std; int main () { int twenties, tens, fives, singles, quarters, dimes, nickles, pennies; double purchase, pay, rempay=0; cout<< "please enter … | |
I have been using GSL, but I find it very awkward to work with. Does anyone have a recommendation for another one to try? I can't seem to find any on google. Thanks, David | |
[CODE] class A { int x; public: A(){} ~A() { cout<<this<<endl<<"bye"<<endl; } }; int main() { A a; a.~A();//bye return 0; // after return 0, destructor will be called and bye will be printed again } [/CODE] the destructor gets called twice. The 1st time, its explicitly called and the … | |
what is the difference between a class declaration and a class definition ? Is it that a class which contains the prototypes of member functions is a class declaration? Is it that a class with member functions defined within the class , is a class definition ? | |
why is the size of an empty class 1 byte ? does the compiler add some null byte ? | |
Hye there.. I just want some ideas to make my program better.. Below is the code. Any comment or recommendation are appreciated. :) [CODE]/* * Name: Isihan dan Carian [Sorting and Searching] * version: 4.0.1 * Copyright © * Support: http://tempek.net78.net * Updates: August 27, 2008 * Compiler : Dev-C++ … | |
Hi, I'm using Expat to parse XML, and I have an array of attributes for an element. I need to be able to loop through them all, and get their values, I don't know the array size, and it's a multidimensional array, so I couldn't do [Code=C++] int count = … | |
How do I sort 10 random numbers using quick sort with push() and pop() ? | |
I'm having trouble reading from my files properly. the files being read from is in this format: Q:3 D:4 N:1 and that is all in the file, it stands for quarters, dimes, nickels. yeah and the function i have to read from that is this: [code=cplusplus] void initialize (ifstream& soda, … | |
I'm having a little bit of trouble using the ifstream 'get' command. When I say trouble I mean it is not returning the values expected and I need a little guidance, if you will :). Basically what I'm doing is reading a file in through C++ and then going to … | |
ight - I have the directory to my app stored in HKEY_CURRENT_USER/ Software/myAppName how do I read it? I've tried searching the RegGetValue but couldn't get it to work/ understand how it works. | |
Hello all. I'm pretty new to C++ but not a total beginner. I have done a little program which basicly is a Timer. It's a clock that starts at zero and counts to 4min 45sec, then it playes a sound and restarts. I want to add a feature which restarts … | |
I have been using the book beginning c++ through game programming witch has been a very good book. I've learned loops, references, pointers, classes, inheritance, dynamic memory, and the very basics. Now I need a book that will help me make programs that do things outside of the console window … | |
#include<iostream> using namespace std; void BubbleSort(int ar[10], int n, int & compare_costs, int & swap_costs) { int t; int swaps=-1; while(swaps) { swaps++; compare_costs++; for(int i=0; i<n-1; i++) if(ar > ar[i+1]) { t=ar; ar=ar[i+1]; ar[i+1]=t; swap_costs=swap_costs+5; } } } int main() { int n, compare_costs, swap_costs; int ar[10]; int *bs … | |
Hello, Now, this may sound stupid, as it concerns basic file I/O, but my code doesn't work correctly- at least it isn't doing what I want it to. I wanted it to write a file the first time it runs, which it does perfectly, and every time it is run … | |
how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing … | |
hello, google, daniweb, and microsoft searches didn't help me with this so i hope that someone here will know. i'm trying to have a method called at a fixed interval of time from the time an application starts until it ends ( RedrawWindow() ). i know how to do it … | |
I'm working on a homework/project to tokenize a set of operands (double) and operators as inputs. It's been going well enough and I have been able to finish it by implementing my own tokenizer but when I tested my output exe with digits greater than 7 I get a random … | |
I've finished writing the program for my class and everything actually does what it's suppose to (well 99% anyway). I'm going to add snippets of the code that should help figure out the small glitch. What's happening is I can add x amount of elements to my stack and display … | |
![]() | I am currently working on a project for a school project along with my friend. We, want a simple source control system, as we are working in a collaborative mode. I know this is not absolutely necessary, but, we still want to learn about source control and what better way … ![]() |
For example we have a class called Treatment. then in that class we have 2 functions that is treat() and treatmentStaff(). Function treatmentStaff() is called from treat(). In main, we create 2 objects for that class, namely Treatment treatmentA, treatmentB; then we assign treatmentA.treatmentStaff(); , treatmentB.treatmentStaff(); I wanna ask, can … | |
I'm trying to generate 100 random numbers from 1-100 into an array. I can generate the 100 random numbers but don't know how to put it into an array. #include<iostream> using namespace std; int main() { int ar; for(int i=0; i<100; i++) { ar =(rand()%100); cout<<ar<<" "; } } | |
Please note before reading this, this is a keylogger, no its not used for malicious purposes as it only runs with the programing prompt open and stops as soon as the program is exited. Just trying to show my computer teachers something, because he's an idiot who gets his lessons … | |
Please help me to find error in this program .I am trying to add data to a dynamic array . [ICODE] #include<iostream.h> #include<conio.h> #include<string.h> class data { private: char(* dynamicarray)[20]; int size1,i; public: data(char(*tmp)[20],int Size) { dynamicarray = new char(Size([20]); dynamicarray = tmp; size1 = Size; } get() { for(i=0;i<size1;i++) … | |
i have made a program on text file to remove extra blank spaces in a file but it is not working correctly. when i run the program just "enter text" appears and after entering the text the screen just remains as it was. Nothing else appears. I cant find where … | |
Hi, I need serious help, cause I really do not how to continue. I cant build project in OPENSOLARIS OS, although there is no problem to build it in WINDOWS. Would anyone know what could be wrong? (without dots)... vojta@opensolaris:~/piskvorky$ make make: Warning: File `AI.h' has modification time 5.6e+04 s … | |
Hi all, I just wanted to ask for your guys advice on two topics. The first one is I'm wondering what is the best library to use for a hash table in a C++, what do you guys use? Or do you implement your own? The second thing is, when … | |
I'm having a compile error, my project is to make a soda machine, complete with 5 dispensers and give change and all that i was wondering if anyone could help me decipher the error, im completely lost about it the line in question is [cout << x << ". " … | |
Hi, I'm starting to program with DirectX. I haven't use pixel or vertex shaders, but I know DirectX supports them. My graphics card is a piece of crap, and it doesn't support pixel and vertex shaders. How could I render them with software or an emulator, so I can test … | |
hi, im using borland c++ builder and I have created a list view which contains 4 colums of data. Im happy with this bit however I would like to make it so the user can select a row from the listview. I have managed to get it so the user … | |
Ive recently spent a lot of time using BSD sockets in Linux to do socket programming. I have written this howto with samples to show a person how to send a message buffer. Feel free to comment on this and correct anything that you think i have said wrong or … | |
I have the following code, which creates children process. Children process is a shell script on unix platform, which prints two lines to stdout. Parent process reads that output via the pipe: [code=c++] char *shell_command = "cd /home/user; for infofile in *.info ; do grep -q 'PID: 10631$' ${infofile} ; … | |
--------------------Configuration: dark blade - Win32 Debug-------------------- Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/dark blade.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. dark blade.exe - 2 error(s), 0 warning(s) that is what I get when building my project the files are below | |
Hello everyone. I am currently studying programming and am really confused when I come to this level. It is to link object files together using a "[COLOR=Green][B][I][U]makefile[/U][/I][/B][/COLOR]". I just wanted to know if I am correct in my understanding so far. If I am wrong in my conclusions please cite … | |
Compositional C++ Has anybody heard about it? | |
The same source code is compiled with g++ (linux) and with visual c++. I found that the program runs much slower on the second one (0.03 seconds vs 0.359 seconds). The program uses <vector> and does a convolution: [CODE] void DSP_fir_gen1 ( vector < double > *x, double *h, vector … | |
Hello all, I need to create a structure with some attributes associated with it: struct SNode { float PrimSet [n]; int size; float value; }; The only problem is the size of the array (i.e. n) is variable and it can be any number below 100, which is unknown before … | |
In my comsc class we are writing a program to determine when easter sunday is, my program works like a charm when i put each equation in a seperate function but when i try and take them out (as per teachers instructions) it craps the bed and gives me an … | |
The following code is part of a program to document the book in my house, like those things they have at public libraries. I learned about minupulating files in programs last night and have many errors in this program. First, the c-style string for filename comes out as - filename.txt" … | |
Can anyone help me with a computer science C++ assignment that i am struggling with? The task is to design and implement a generic reference counted smart pointer class library, and use the smart pointers to create a smart generic linked list class... any help would be greatly appreciated... Thanks | |
Im looking for a microsoft excel example. I found this here [url]http://www.daniweb.com/forums/thread102795.html[/url] but dosent give a small example of code in work. What I gathered from the above thread was: - You cannot write to xls extensions (What about xlsx 2008 office? & can you write to xls?) - Each … | |
Hi there, I just started a course on school for data structures using c++. I program in C# and I have no issues with it hoeever a lot of statement in c++ are new to me. I understand the professor completely when he explains but I am lacking syntax etc. … | |
How do you delete the front cell of an array in an array based circular queue? Here's the Queue cpp functions [code] #include <iostream> #include <string> #include "Contributor.h" #include "myQueue.h" using namespace std; myQueue::myQueue() { front=0; rear =0; Index=0; size= 0; ArrayQ[10]; } myQueue::myQueue(const myQueue &CCmyQueue) { for(int i=0;i < … |
The End.