49,761 Topics

Member Avatar for
Member Avatar for johnson_2

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

Member Avatar for johnson_2
0
610
Member Avatar for saja.omarii.7

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 …

Member Avatar for saja.omarii.7
0
376
Member Avatar for mixelplik

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 …

Member Avatar for mixelplik
0
132
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
148
Member Avatar for 9tontruck

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 …

Member Avatar for Moschops
0
202
Member Avatar for cambalinho

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)

Member Avatar for cambalinho
0
288
Member Avatar for PulsarScript

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 …

0
89
Member Avatar for royi.navon

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

Member Avatar for Nutster
0
102
Member Avatar for asaidi

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 …

Member Avatar for asaidi
0
114
Member Avatar for zigzagzig

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

Member Avatar for Ancient Dragon
0
140
Member Avatar for arezooabyaneh
Member Avatar for PulsarScript

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 …

Member Avatar for owenransen
0
187
Member Avatar for Wayne.H94

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 …

Member Avatar for owenransen
0
169
Member Avatar for super.sam1
Member Avatar for rajol.singh1
0
627
Member Avatar for cambalinho

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

Member Avatar for cambalinho
0
2K
Member Avatar for PulsarScript

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.

Member Avatar for llgms
0
144
Member Avatar for prashantsharmazz

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/

Member Avatar for prashantsharmazz
0
118
Member Avatar for drgr33n

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 …

Member Avatar for Juan_8
0
376
Member Avatar for catastrophe2

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 …

Member Avatar for catastrophe2
0
186
Member Avatar for VUEKID

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 …

Member Avatar for VUEKID
0
177
Member Avatar for johnson_2

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 …

Member Avatar for johnson_2
0
664
Member Avatar for catastrophe2

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 …

Member Avatar for catastrophe2
0
224
Member Avatar for catastrophe2

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 …

Member Avatar for catastrophe2
0
215
Member Avatar for cambalinho

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 '...'?

Member Avatar for Ancient Dragon
0
7K
Member Avatar for cambalinho

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

Member Avatar for cambalinho
0
386
Member Avatar for PulsarScript

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

Member Avatar for mridul.ahuja
0
127
Member Avatar for sanjit.dasgupta2

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

Member Avatar for sanjit.dasgupta2
0
1K
Member Avatar for Massive++
Member Avatar for rubberman
0
171
Member Avatar for azwitsal

c++ program codes that computes for density, wherein mass and volume are asked from the user?

Member Avatar for kal_crazy
0
86
Member Avatar for CHARLES_5

write and test(using a complete c++ program) a function that appends one array of integers to another.

Member Avatar for Lerner
0
79

The End.