49,761 Topics
| |
help plz...I have to create a program that multiplies matrices...those elements in the array must come from a file or reads a file...I have constructed these codes but this program lets the user type their number, not read from a file..I have these code so far...[CODE]#include <cstdlib> #include <iostream> #include … | |
Hi, i am new to c/c++ and i need to execute external cabextract program to extract archive, but if i sprintf command and file name to command variable i get segmentation fault. How i need to modify code to avoid segmentation fault? Here's an example: [CODE=C++]void cabext(const char *fname) { … | |
Is it possible to make the window block thing in your toolbar flash when an event happens? i couldnt really think of what function would do this. | |
[CODE=cplusplus] #include<iostream> using namespace std; int intro(); double getData(); double averageHigh(); double averageLow(); double indexHighTemp(); double indexLowTemp(); double table(); double i,j,hsum=0,lsum=0,aveh,avel,high=0,low=0,ind; int const row=2,col=12,num=12; double temp[row][col]; char month[20][num]={"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"}; char space[]=" "; int main() {getData(); table(); averageHigh(); averageLow(); indexHighTemp(); indexLowTemp(); return 0; } int intro() { cout<<"||||| |||| ||||| |||| |||| … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
//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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
[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. … | |
[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" << … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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] … | |
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 = … |
The End.