49,761 Topics
| |
I am new to socket programming and I am trying to establish a connection between my client and server and if it's successful the user can 1) -Input message, the message will be send to the server -the server will send a "I got your msg" back to the client. … | |
Write C++ a program that reads a person's age in years and print his/her age group. See the table below. Age Group name 1 year Childhood 2-3 years Infancy 4-5 years Preschool-Age 6–12 years School-Age 13–17 years Adolescence 18–29 years Young-Adulthood 30–39 years Thirties 40–64 years Middle-Age 56–48 years Aged … | |
I was working on a praxctice program and wanted some numbers fixed dollar amounts to 2 decimal places while others to be displayed as plain old ints. I used this code, but noticed that now ALL numbers are set as fixed 2 place decimals. Is this how fixed and setprecisioun … | |
i'm learning win32 from: http://www.winprog.org/tutorial/start.html but tell me(because i ear several persons) is these function correct? LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } the DefWindowProc() is … | |
class Base{ Base(); ~Base(); void doSomrthing(); } Class MyCLass : public Base{ std::string name; MyCLass(); ~MyCLass(); void init(); } MyCLass::MyCLass() { init(); //runtime error occurs with this line } void MyCLass::init() { name = "MyClass"; doSomrthing(); } I am having a trouble on calling child class' contructor. What is wrong … | |
how can i test if the wheel move was negative or positive? i belive these detect the mouse position: xPos = GET_X_LPARAM(lParam); yPos = GET_Y_LPARAM(lParam); but how can i test if any key(like alt\control\shift) was pressed? (i'm talking in same message) | |
here is the code #include "stdafx.h" using namespace std; void GetPicture( ifstream& infile, int picture[8][8]); void GetCanvas( ifstream& infile, int canvas[45][75]); void InitBlank( int blank[8][8]); void InsertPictureInCanvas( int picture[8][8], int canvas[45][75], int startrow, int startcol); void ShowCanvas( int canvas[45][75] ); void Delay(int time); int _tmain(int argc, _TCHAR* argv[]) { //load … | |
//A1 = 1 //An = An-1 +sqrt(An-1) for n > 1. //i need to find An of the series according to the estimation An=(n^2)/4 //how do i write a member of the series, let's say "An" in the code and to apply "n>1" in the code? | |
HI just starting learning c++ and i think it is a good choice what youn think ? my question why are we using vectors of objects..we can store infos inside a vector and the we can display them the problem if i quit the program everything is gone..work on memory … | |
I have been absent from our programming lessons and have only attended 1 which was the first one where we just did "Hello World" out of a possible 5, but I still need to do the homework. I have been sitting here sweating over some code for a long time. … | |
Hi all,can enyone give a solution ,how to emplement random function,so it could randomly select numbers from the saved text file(grid) and output in matrix . What i try to do is:Create animation project,but would like color matrix as a background.What i did so far is came up to the … | |
i have some code about the Hanoi Tower here #include<stdio.h> #include<conio.h> #include<stdlib.h> void cthap(int m,int x1,int y1,int x2,int y2,int x3,int y3) { if(m<1) return; else if(m==1) printf("\nchuyen tang 1 tu (%d,%d) tới (%d,%d) ",m,x1,y1,x2,y2); else { cthap(m-1,x1,y1-1,x2,y2,x3,y3); printf("\nchuyen tang %d (%d %d) toi tang (%d %d)",m,x1,y1,x2,y2); cthap(m-1,x3,y3,x2,y2-1,x1,y1); } } void … | |
C++ program to find sum of marks entered by 30 students using for loop or while loop/ | |
see my windows procedure: LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { bool blnMouseEnter=false; switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_KEYUP: if (wParam ==VK_ESCAPE) DestroyWindow(hwnd); else { char strDataToSend[32]; sprintf(strDataToSend, "%c", wParam); MessageBox(NULL,strDataToSend, "keyselected",MB_OK); } break; case WM_MOUSEMOVE: SetWindowText(hwnd,"hi"); break; case WM_MOUSELEAVE://is ignored :( SetWindowText(hwnd,"bye"); break; … | |
Hi to all,could anyone please suggest the animation project? I am on the first year of software development course and need to start with animation project.Any ideas,suggestions?Regards. | |
KNOW THE LOGIC BEHIND FACTORIAL PROGRAM And CALCULATE FACTORIAL OF VERY LARGE NUMBERS ! **WHat is the most efficient way of calculating the factorial of the number ?** http://www.lifengadget.com/lifengadget/program-to-find-factorial-of-number-in-c-plusplus/ | |
Hey Guys, Was reading a few posts on here and looks like a cool place to come and try to broaden my knowledge and try and teach myself C++. I've only been reading a few days and I decided to try and create a simple calculator. I wanted to see … | |
hi i have this assignment in c++, i did it, but there is one tiny error i cant figure out the solution to it. the program below is supposed to take in 3 elements value inputs from user for 3 students. so if you run it, you get input student1 … | |
I have read a text file to console and printed the file after reading, int textLength=0 int c; int c; FILE *file; file = fopen("ModestProposal.txt", "r"); if (file) { while ((c = getc(file)) != EOF) putchar(c); //fclose(file); } textLength = strlen(c);//get the length of the text How come I can … | |
I have a text file points.txt which is formatted by Point2D/Point3D , X ,Y points.txt Point2D, [-9, -9] Point3D, [-9, -9, -9] Point2D, [-99, -99] Point2D, [-999, -999] Point3D, [-999, -999, -999] What I want to do is 1) retrieve the X and Y values that belong to Point2D from … | |
hello we have to make a program that grades multiple choice exams from input files by the user and outputs the id of each student followed by their appropriate score. here are the input files: > exam file abcdefabcdefabcdefab 1234567 abcdefabcdefabcdefab 9876543 abddefbbbdefcbcdefac 5554446 abcdefabcdefabcdef 4445556 abcdefabcdefabcdefabcd where the first … | |
hello everyone new here and i am currently taking my first ever c++ class, so completely new to c++. i made an account here, in which i was able to post a question i had a bout a project for grading program, then i received email of required activation which … | |
i'm building a class with std::function for recive several parameters or none: class event2 { public: typedef std::function<void(...)> OnSomethingHandler; void operator() (...) { eventwithoutarg (...); } event & operator = (OnSomethingHandler Handler(...)) { eventwithoutarg(...) = Handler(...); return *this; } private: OnSomethingHandler eventwithoutarg(...); }; what i'm doing wrong with '...'? | |
see these sample: template <typename a> class test { test(a argument) { cout << argument; } }; //declare it: int main() { test<string> a("hello"); } how can i do it: test a("hello"); | |
Hi to all, i need to implement ofstream outfile code. Here is my code.How can i implement the ofstream outfile to ,so that the contents of the collection are re-written to the file before the application terminates. #include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int list[12]; … | |
I am using Turbo C++ 3.0. Things to be noted : 1.) I am very new to C++ 2.) I can only use the above said compiler. 3.) List, vector, functions, classes, file-handling, structures, templates and objects cannot be used in the program as per my assignment. Here's my Code: … | |
I need C++ CODE for appending an int array passing pointer | |
c++ program codes that computes for density, wherein mass and volume are asked from the user? | |
write and test(using a complete c++ program) a function that appends one array of integers to another. |
The End.