49,756 Topics

Member Avatar for
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
139
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
186
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
168
Member Avatar for super.sam1
Member Avatar for rajol.singh1
0
623
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
143
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
185
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
662
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
223
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
213
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
6K
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
380
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
126
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
78
Member Avatar for SpottyBlue

I have a problem when creating the Personal Finance Software in my group. It's part of my group's assignment. The EnterExpense() function only creates one line instead of many (if the user wants to continue entering more info). The ViewInfo() function can read the file, but cannot load the text …

Member Avatar for richieking
0
274
Member Avatar for vladimir.bednoi

Good day, I need help with my code. It's very simple and I was compiling it successfully at school, but at home I'm having problems with it. Here is the code. http://gyazo.com/dc78a310f529374338a244227b56215f and #include <cmath> #include <iostream> #include <conio.h> using namespace std; int main () { float a, b, c; …

Member Avatar for Moschops
0
274
Member Avatar for Lawrence Motshegetsi

Write a program that will get/input 10 employees data, then input time started to work hours then minutes, then employee should input time finished work hours then minutes. then find how many hours 1 employee worked and the average time worked by all employees. use arrays.

Member Avatar for rubberman
0
90
Member Avatar for cwarn23

Does anybody know where I can find a c++ object oriented library for my c++ project where in short I can set each pixel on each frame to a specified color and saving the result to a .avi file preferably compressed. I know this sounds simple in theory but I …

Member Avatar for rubberman
0
400
Member Avatar for Rawan_92line

Hi , i'm Rawan 21 YO , CS student (3rd level) ! i'm looking forward to learn more from y'all!! hope i can help somebody someday ^^

Member Avatar for Boudreauxcs
0
134
Member Avatar for daino

Would anyone know of a C++ library which can enable me to encode and decode Ascii base 85 encoding? I'm having trouble finding one on the web. Thanks

Member Avatar for daino
0
1K
Member Avatar for kruschev

#include <string> #include <iostream> #include <vector> using namespace std; class Person { public: Person(); Person(string n, string a, string tel, string em); string getName(); string getAddress(); string getTel(); string getEmail(); virtual string whatAmI(); private: string name, address, telephone, email; }; Person::Person() { } Person::Person(string n, string a, string tel, string …

Member Avatar for Krimeplay
0
358
Member Avatar for idnurr

To get and set various variables inside structs in C++The main struct object should be a pointer.the structs have got so many member function to get and set it variables from the user.finally the structs should be protected in such a way that no two users can change the details …

Member Avatar for rubberman
0
129

The End.