49,767 Topics
![]() | |
[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 = … | |
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, … | |
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 … | |
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); } } … | |
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 … | |
I want to find server Ip. Server and clients are connected in Lan ..... how to do this?? | |
//help please to solve this problem for multiple programs //with arrays. //The purpose of this program is to calculate the car charges //in a parking lot. this program is working for 1 car. //My assignment is to make a program that works for multiple cars //at the same time. //to … | |
I have a function inside another function that is called by main(). Inside the innermost function a vector is created, which I would like to return to the first function, which I would further like to return to main(). I suppose that I could create the vector in main and … | |
I am having a compiling issue because of some syntax errors while trying to return an array. You can probably ignore most of the code below; I am only concerned with the call and return of the CreateBoard[][] array. As I understand a pointer might be necessary to do this. … | |
Hello everyone. This is my first post here. I am only posting here under the most extreme circumstances because I cannot for the life of me figure out how to make my save function for RPG game to work. So for it will only save in the first room. So … | |
I need help where it say /* write code to withdrawal money from account1 */.. i think the member function is written right but im not sure. Im a true begginer taking this online course and I think i have most of it right, can someone please help guide me.. … | |
I have a function Scan.MakeLinearGrid() which returns a vector<vector<Vector3> > I have another function that is made to accept this type of thing: Scan.setAngleList(vector<vector<Vector3> >); But if I call it like this: [code] Scan.setAngleList(Scan.MakeLinearGrid()); [/code] it says [code] error: initial value of reference to non-const must be an lvalue Scan.setAngleList(Scan.MakeLinearGrid()); … | |
Hi everyone, I am a just beginning Win32 Application Programming for C++. I really couldnt find any site that didnt confuse the heck out of me. Alrighty, I'm not here to ask you questions about acutally learning Win32, but i would like to know if you could recommned me a … | |
Need help! supposed to take in 6 project grades and 2 test grades... multiply each by %50 and add together for final average. however, i cant figure out how to add the integers in the array much less compute the average... any help is highly appreciated!!! heres the code: #include … | |
Hello everyone, can anyone please suggest some problems (intermediate) which could be implemented in both C++ and java bringing me back on the track. i studied C++ 4 years back and java 2 years back. i was quite comfortable with the concepts and logic. but for now about 2 years, … | |
THIS IS MY QUESTION........PLEASE SOLVE IT........... Write a complete program to read 15 numbers type of integer and calculate the number of the same number. (Use : loop, array, function) Example: Please enter 15 numbers : 2 4 5 6 2 2 7 5 5 2 2 2 4 4 … | |
I am working on this code and everything is working but for some reason when i go and do case 3 for remove it removes the code but continually asks for me to remmove and no matter what i type it will not go back to default options for me … | |
Hi, I have been asked to write C++ program to calculate the factorial for numbers from 1 until 255, the problem is that no variable exist as far as I know that can handle the result for calculating 140! And greater “I am not sure about the number but it … | |
I posted here about 2 weeks ago discussing what library I should use for my text based RPG game in c++ console development. I talked to my teacher about it, and he said that plagiarism was a huge concern, so I have to document nearly every aspect of my program … | |
Hi mates So i have a big project for my school...and the bad news are that i am a noob in C++.. In VCL enviroment i try to take an AnsiString Text from a listbox or EditBox and convert it into a integer array in order to do some calculatos … | |
please if yuo have graphics.h for microsoft visual.net 2003 c++ can you send it to me thanks | |
What i'm trying to do is, basically, link one C++ File, to another. For example, first i have a cpp file, like, main. And I want to have a part where the user chooses something then the other cpp file opens. | |
Hello, Sorry if this is a basic basic question. I am familiar with doing console projects, but I am trying to do a gui project and the rules just don't seem to be the same. I have two basic questions. 1) Why can I not include fstream and/or string headers … | |
I supposed to make in memory linked list. I thought I did it perfectly. My teacher is kind of the teacher that won't teach you but let you figure it out.. I couldn't figure it out!!! I supposed to make one like this but to manipulated the list. I am … | |
i have here a code..... can anybody tell me how to:-O change the '*' to 'X' when a user will input his desired seat..... :( #include<iostream.h> #include<conio.h> #include<iomanip.h> int userInput(); int main() { clrscr(); int x,y; const int row= 12,seat= 5; char plane[row][seat]; cout<<"\t\tAirplane Seat Arrangement"<<endl; cout<<"\tA\tB\tC\tD\tE\tF"<<endl; {for (y=1;y<=13;y++) { … |
The End.