49,757 Topics

Member Avatar for
Member Avatar for masoud87

hello i have a program that is written by Borland C++Builder 6 it is a program for writing binary files using ofstream. but when i ship this program to Borland C++Builder 2006/2007 and compile it,the run time of program increased very much. for example you can test this standard code …

Member Avatar for Ancient Dragon
0
325
Member Avatar for Cybulski

I'm trying to implement critical section using objects listed in this article: [url]http://www.mycplus.com/tutorial.asp?TID=290[/url] Somehow, it doesn't work like intended, or maybe I do something wrong. Basically my concept looks like this: [code=cplusplus] DirectoryReader::DirectoryReader(char* p_sConfigPath) { GetConfig(p_sConfigPath); if( hReaderMutex = CreateMutex( NULL, FALSE, "ReaderMutex") ) cout << "Mutex created!" << endl; …

Member Avatar for Ancient Dragon
0
567
Member Avatar for masoud87

hi all i have a program for reading/writing files using windows API this program works properly but i have problem with program speed the time of reading the file is good but it takes very more time for writing the file here is the standard source code that my program …

Member Avatar for dougy83
1
111
Member Avatar for ff4930

Hello everyone, My project consists of reading 2 lines of integers separated by white spaces corresponding coefficents and exponents, each line representing a polynominal. I have to add both polynominals and subtract them. I have made a linked list class to hold each coefficent and exponent in a node. The …

Member Avatar for VernonDozier
0
109
Member Avatar for henpecked1

I have the function below in three base classes, one base, then one derived, and another derived from the second. I'm getting external resolution errors when I try to build it. [code] virtual void printtostream(ostream& out); //Since it is a virtual function the above was not defined in any of …

Member Avatar for henpecked1
0
125
Member Avatar for purepecha

//help please, i just want the program to tell me // if there is a repeated # on the string // is always true or false #include <iostream> using namespace std; const int ARRAY_SIZE = 5; bool valid2(const int list1[]); void fillArray(int list1[], int ARRAY_SIZE); void printArray(const int list1[], int …

Member Avatar for joshmo
-1
110
Member Avatar for imtnan

Hello, I am a newbie and trying to pass a 2 - dimensional array to a function in C++ from main(). Then, [B]once inside that subroutine[/B], I want to [B]change the contents of this 2D array[/B] and be able to [B]access the changed elements of this 2D array later[/B] in …

Member Avatar for dougy83
0
3K
Member Avatar for sanchit223

I am trying to write a shared library using C but need to call some C++ functions. So I have created a shared library containing the required C++ functions. How can I call those function from C code, I tried dlopen() and dlsym() in the C code. It creates handle …

Member Avatar for Ancient Dragon
0
156
Member Avatar for henpecked1

I have a "two stage" inheritance piece I'm writing. The overall class is telnumber, the worknumber is derived from telnumber, and billnumber is derived from worknumber. The problem is in in my billnumber.cpp. In the main there are two lines referring to the billnumber class with only 4 parameters, and …

Member Avatar for henpecked1
0
172
Member Avatar for amarjot

I am cse student. I wud be goin to 3rd yr now..can any1 tell me about how we can assess databases usin c++???? I need it urgently

Member Avatar for Salem
0
55
Member Avatar for Jenny Collins

I got the average to work, but how can I make this program first list the high & low temps? Any help with this would be great. int sum, count; sum=0; count=0; do { count++; int number=readNumber(); sum=sum+number; cout << "The average is " << sum/(double)count << endl; } while …

Member Avatar for vmanes
0
117
Member Avatar for ff4930

Hello everyone, This program compiles fine and runs fine in Eclipse(C++ IDE) but when I compile it in UNIX and Visual Studio its fine but when I run it, it gives me an error. For Unix is segmentation fault The problem is when I initialize VNT, it calls Matrix and …

Member Avatar for ff4930
0
77
Member Avatar for zoner7

As I write my code, I am realizing there are numerous places where a type int could easily be substituted with a type char. Because type char uses less memory than its int counterpart, I am curious why people don't prefer the former more often. for example, it's not uncommon …

Member Avatar for Radical Edward
0
525
Member Avatar for 007tron

Hi all, i was hoping some on could help me solve this problem i am having:i have been going over it for the past two hours but can not find the mistake\s. I have three files i am working on 1 header and 2 cpp ones(implementation of header file and …

Member Avatar for 007tron
0
131
Member Avatar for sniper29

[SOLO] Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: a. FunctiongetData:Thisfunctionreadsandstoresdatainthetwodimensionalarray. …

Member Avatar for jephthah
0
398
Member Avatar for FreeFull

[CODE=c++]#include <iostream> using std::cout; bool help = 0; bool expl = 0; int main(int argc, char *argv[]) { for(int i=1; i + 1 <= argc; i++) { if((argv[i] == "-h" | argv[i] == "--help" ) && help != 1) { cout << "This is an experiment for parsing arguments.\n" << …

Member Avatar for William Hemsworth
0
119
Member Avatar for feru33

Hey there, I'm fairly new to programming but have been tasked with writing a Ymodem send program to send some data that I parsed out to hardware. So far I have parsed data into a char array, and then opened up a serial port. I just don't know where to …

0
54
Member Avatar for Jennifer84

I wonder something. I have a Form with Vertical ScrollBars. When running this code below that are inside a buttoncontrol when the scrollbar is at the top of the Form, the Form Scroll downs a bit, perheps 5-10 cm. This is because I set button1->Enabled = false; [I](I don´t know …

Member Avatar for Jennifer84
0
434
Member Avatar for joshmo

I am doing a simple program that will add elements to a static stack using structures but Iam failing to implement it. The proram accepts input the first time but then crashes after that. Here is my structure declaration [code=cpp] struct stack{ int top=1; int values[4]; }; [/code] the definition …

Member Avatar for Sky Diploma
0
87
Member Avatar for 007tron

Hello everyone, I have got some questions and i am really hopping someone could help me out with them. I have a class privately encapsulated in another class. Now, I'm trying to make an object of it in my testDriver but I'm not quite sure how to do that. I've …

Member Avatar for 007tron
0
113
Member Avatar for theUnspeakable

[code=cplusplus] #include <iostream> #include <string> using namespace std; int findNum () { int num; cout<<"You have 10 chances to guess the number that is generated by this program."<<endl; cout<<"All numbers generated are of positive integers"<<endl<<"Good Luck!!"; cout<<"Enter you guess "; cin>>num; return num; } string start (int guess) { int …

Member Avatar for Sky Diploma
0
91
Member Avatar for Fiume

So.... I"m trying to use MPI_Bcast because it seems like the easiest way to take a multidimensional array (the full program has a 3-d one all filled out) and make it available to every process. The code below, however, does not work... 'grid' holds nothing but 0s when accessed from …

Member Avatar for Fiume
0
177
Member Avatar for daviddoria

Right now this is my setup: I have these classes Point2 Point3 Vector2 Vector3 Ray2 Ray3 Both Point classes and both Vector are independent. Ray2 contains a Point2 and a Vector2 object, and Ray3 contains a Point3 and a Vector3 object. I have two questions. 1) Should I somehow just …

Member Avatar for Radical Edward
0
111
Member Avatar for niitian

hello everyone. i need a bit of help in this project of mine which is due in 2 weeks.. here's what needs to be done, but i have no idea about the logic:( if somebody can help me with the pseudocode or algorithm, i could write the code maself.. [B]Write …

Member Avatar for Nick Evan
0
157
Member Avatar for rpamballa

Can someone go through the following code whic generates shortest path for randomly generated processes. My code is generating a segmentation error when I run it, and I am unable to locate the bug. //This program implements the O(n) algorithm for finding shortest path for randomly generated processing times [code=cplusplus] …

Member Avatar for Cybulski
0
169
Member Avatar for Yourself

hi, I develloping an engine but I have an small error and can't find it... I want the user the say with icon he wants to use for his program : [CODE] WNDCLASSEX wndclass; // ... wndclass.hIcon = LoadIcon(m_hInstance,MAKEINTRESOURCE(GetIcon())); wndclass.hIconSm = LoadIcon(m_hInstance,MAKEINTRESOURCE(GetIconSmall())); // ... void SetIcon(WORD icon) { m_wIcon = …

Member Avatar for Yourself
0
335
Member Avatar for FTProtocol

main.cpp [CODE] #include <windows.h> #include "Resource.h" HWND hWnd; LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { DialogBox(hInstance, MAKEINTRESOURCE(IDD_Main), hWnd, reinterpret_cast<DLGPROC>(DlgProc)); return FALSE; } LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { HWND hwStart, hwServer, …

Member Avatar for FTProtocol
0
707
Member Avatar for kux

Hello, I have a CListCtrl and a button to modify the selected row in the CListCtrl. My problem is that my list has several columns and I want to be able to select a row by clicking on any column of the row that I want selected. Now I can …

Member Avatar for Aashath
0
1K
Member Avatar for Cybulski

I'm trying to call this function requested times. All functions and variables are members of one class, access is public. So, I'm calling like this: [code] void MultiReader::CreateThreads() { unsigned int nThreadNo; for( nThreadNo = 0; nThreadNo < vDirectories.size(); nThreadNo++) { CreateThread( NULL, 0, &MultiReader::ReaderThread, vDirectories.at(nThreadNo).sDirectoryName, 0, NULL); } } …

Member Avatar for Cybulski
0
847
Member Avatar for joshmo

I am studying stacks, queues, and heaps at the moment but i dont know how i can apply this in real life. Well my question is how can these may i say operations helpful and when are they really needed as opposed to others. I hope you can get my …

Member Avatar for Alex Edwards
0
137

The End.