49,761 Topics

Member Avatar for
Member Avatar for LiquidScorpio81

#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 …

Member Avatar for VernonDozier
0
999
Member Avatar for amrith92

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 …

Member Avatar for amrith92
0
120
Member Avatar for milonimim

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 …

Member Avatar for Salem
0
155
Member Avatar for sciwizeh

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 …

Member Avatar for sciwizeh
0
208
Member Avatar for Repurcussion

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 …

Member Avatar for Repurcussion
0
160
Member Avatar for RayvenHawk

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 …

Member Avatar for Radical Edward
1
3K
Member Avatar for DigitalPackrat

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 …

Member Avatar for DigitalPackrat
0
200
Member Avatar for need_Direction

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 …

Member Avatar for mitrmkar
0
144
Member Avatar for LiquidScorpio81

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<<" "; } }

Member Avatar for Salem
0
85
Member Avatar for Niklas

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 …

Member Avatar for cikara21
0
162
Member Avatar for vijaysoft1

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++) …

Member Avatar for cikara21
0
93
Member Avatar for tracethepath

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 …

Member Avatar for udayasankar
0
9K
Member Avatar for MalejProgramato

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 …

Member Avatar for MalejProgramato
0
295
Member Avatar for bleh1318

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 …

Member Avatar for Narue
0
120
Member Avatar for slytherfreek

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 << ". " …

Member Avatar for slytherfreek
0
135
Member Avatar for TheBeast32

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 …

0
51
Member Avatar for tootypegs

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 …

Member Avatar for mitrmkar
0
207
Member Avatar for sparty

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 …

0
65
Member Avatar for psycheheaven

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} ; …

Member Avatar for psycheheaven
0
107
Member Avatar for errorman

--------------------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

Member Avatar for Narue
0
160
Member Avatar for sadaka

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 …

Member Avatar for sparty
0
153
Member Avatar for Ninabox
Member Avatar for mabuse

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 …

Member Avatar for mabuse
0
451
Member Avatar for salman1354

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 …

Member Avatar for grumpier
0
260
Member Avatar for SurviBee

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 …

Member Avatar for ArkM
0
221
Member Avatar for shipeshipaca

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" …

Member Avatar for littlestone
0
153
Member Avatar for c++_student

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

Member Avatar for Alex Edwards
0
121
Member Avatar for OmniX

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 …

Member Avatar for l4z3r
0
246
Member Avatar for nesfrank

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. …

Member Avatar for henpecked1
0
113
Member Avatar for henpecked1

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 < …

Member Avatar for littlestone
0
150

The End.