51,593 Topics

Member Avatar for
Member Avatar for octavia

[code=cpp] //array of pointers to person objects #include<iostream.h> class Person { protected: char name[40]; public: void getname() { cout<<"\n Enter name:"; cin.getline(name,40); } void putname() { cout<<"\n Name="<<name; } }; void main() { Person*persptr[100]; int n=0; char choice; do{ persptr[n]=new Person; persptr[n]->getname(); n++; cout<<"\n Enter another(y/n)? "; cin>>choice; }while(choice=='y'); for(int …

Member Avatar for vijayan121
0
292
Member Avatar for hakeemtunde

Hello guys; Please I want to compile project that has a Static link Library of which I want it to automatically Copy it self(.Lib) to a specific folder when ever I build it and also copy the Include (.h) file to a specific folder of my choice. I will be …

Member Avatar for Salem
0
62
Member Avatar for Jade_me

Hi i newbie in this forum. i have dat file and i want to read this file but i dont know how to start. actually i really confused.. anyone know ho to do this? Pleas help me... Ok.thx in advance.. best regards..

Member Avatar for Salem
0
102
Member Avatar for memo_c++

[COLOR="Green"]Hello guys I need quick help I need a code that reads from a text file and then shows how many “a ,b, c ….” I have in the text[/COLOR]

Member Avatar for ithelp
0
83
Member Avatar for mr_fake

hey! friendz plz tell me how to insert time in a running programme ,which is similar to system clock time.

Member Avatar for WaltP
0
81
Member Avatar for Alishaikh

This works and shows the factors or tells if the number is a prime number but doesn't show ODD factors please help!! I need to turn this tomorrow [CODE] #include <iostream> using namespace std; int prime(int num); int main() { int num; cout<<"Enter number: "; cin>>num; if(prime(num)==1) cout<<"The number is …

Member Avatar for Duoas
0
94
Member Avatar for tootypegs

Here is my scenario i have a file 2000 bytes long. I want to read bytes 500 - 1500 so that i have the middle 1000 bytes stored. I then want to disect the 1000 bytes into 20 bte chunks and preform calculations on ever 20 byte sectiong until the …

Member Avatar for VernonDozier
0
301
Member Avatar for kv79

Hi i need help with IMAGE_BITMAP Here is my code for example how to do it with standard bitmaps. [code=cpp] HWND hBmpBtn=CreateButton(hwnd,cs->hInstance,BS_BITMAP,rc,IDBC_BITMAP, _T("BITMAP BUTTON - NO TEXT")); HBITMAP hBmp=reinterpret_cast<HBITMAP>(LoadImage(0,MAKEINTRESOURCE(OBM_CHECK), IMAGE_BITMAP,0,0,LR_SHARED)); SendMessage(hBmpBtn,BM_SETIMAGE,IMAGE_BITMAP,reinterpret_cast<LPARAM>(hBmp)); [/code] So i need someone who can write me how to make a my own image bitmap(for my pushbutton) …

0
47
Member Avatar for rab786

Create a class in C++ name Account with the following Data members • AcNumber • AcHolderName • AcBalance • Actype • AcMinBalance And the following member Functions Identifier Return type Parameters CreateNewAccount Boolean Integer AcNumber, StringAcHolderName, String AcType, Long Deposit ShowAcInfo void void (No parameters ) ShowAcInfo void String InfoType …

Member Avatar for ShawnCplus
0
97
Member Avatar for michaelmac

Hi Everyone A newbie here. When I have a programming question, do I start off by doing this first [code] #include <iostream> int main( int argc, char **argv ) { std::cout << "Hello World" << std::endl; return 0; } [/code] or is that not right? when I do inline code... …

Member Avatar for Narue
0
77
Member Avatar for jetru

Hey, I just started learning OpenGL. I have a problem understanding the coordinate system. [code] glVertex2d(1,2); [/code] Now obviously, the coordinates aren't in pixels. The problem is I want to mark pixels on my windows and I can't figure how to do this. How big is one unit? I tried …

Member Avatar for Salem
0
60
Member Avatar for flask

[CODE] struct link { char name[50]; int value; link* next; }; class linklist { private : link* first; // ilk baglantiyi tutar public: linklist() { first=NULL; } void additem(int d,char a[]); void display(); }; void linklist::additem(int d,char a[]) { link* newlink=new link; newlink->value=d; strcpy(newlink->name,a); newlink->next=first; first=newlink; } [/CODE] this is …

Member Avatar for flask
0
79
Member Avatar for venkat123

Hi, Can anybody know how to get contiguous free space sectors or unused sectors in a partition? If anybody know how to code in c/c++/visual c++ for this or any idea on how to get this information, let me know. All types of Views are welcome. Waiting for your valuable …

0
57
Member Avatar for austinslik

Hello can anyone give me an idea of a project that I can do on C++ Please can you support your advice with something that i can read about it? its ok if not. Thanks, thanks in advance.

Member Avatar for Jishnu
0
130
Member Avatar for bis student

I have these question and I need some help from you : Assume that the maximum number of students in a class is 50. Write a program that reads students' names followed by their test score from a file and outputs the following: a. class average b. Names of all …

Member Avatar for amt_muk
0
143
Member Avatar for Leil@

I need a code which send output directly for printig i mean istead of veiwing program's output on screan(monitor) it should print it

Member Avatar for ithelp
0
56
Member Avatar for wamuti

Hi guys. Is there a Forum or Section that deals with windows programming in C++?

Member Avatar for WolfPack
0
61
Member Avatar for kv79

Hi i will ask maybe stupid question. I have a this. wcx.lpszClassName = classname.c_str(); and i do not understand context classname.c_str(); ??? I know in C just put "windows name".

Member Avatar for kv79
0
106
Member Avatar for wamuti

Hi. I am using CFormView class in MFC where i have a Dialog Box as a child of the view. Is it possible to draw on th dialog. I realized that there is no virtual function i can override like in a CView. Please Help Out.

0
62
Member Avatar for apcxpc

Hi all I'm experimenting with win API gui stuff, and I've run into a problem with dialog boxes. Currently, when the "Show DialogBox" option in the menu is pressed, the dialog box pops up. I then need for this dialog box to be draggable/moveable, and to "hide" when its close …

Member Avatar for wamuti
-1
266
Member Avatar for smile!

I have a question in c++ , can you help me ,and tell me where is the proplem in my solution ? The question is: Assume that the maximum number of students in a class is 50. Write a program that reads students' names followed by their test score from …

Member Avatar for wamuti
0
114
Member Avatar for Sawamura

hi all, i m new in this forums. i want to save int file into dat in according to biner. please help me cause i dont know how to start.. thx.. best regards...

Member Avatar for Jx_Man
0
220
Member Avatar for abhi_elementx

Hello people, I need help with a template program that i am writing . I am trying to emulate Stack operations using template class which works fine with all the datatypes except char* [B]when using all the datatypes at the same time.[/B] What I am trying to do is [B]pass …

Member Avatar for abhi_elementx
0
104
Member Avatar for #include<DAN.h>

Does anyone know how to use a for loop to clear a 2D array? To clear a 1D array, for example you might do this: [CODE] char array[10]; for (int ct; ct<=10; ct++) { array[ct] = "\0"; } [/CODE] What I'd like to know is how to clear a 2D …

Member Avatar for Duoas
0
2K
Member Avatar for xdream

i having problem on the game is tied part. when i run the program it end with player 3 win. tis is the programe i hv [code=c++] #include <iostream> #include <string> #include <cmath> using namespace std; class TicTacToe { public: TicTacToe(); int Pick_Player(); int Pick_Row(); int Pick_Column(); int Check_Board(); void …

Member Avatar for xdream
0
172
Member Avatar for clairedubaer

I'm trying to make a mathematics game in Borland C++ v4.52. My game consists of multiple mathematical problems moving down the screen, while the user is able to enter the answer to any of these problems. Once the user has entered the problem, the problem disappears. My problem is that …

Member Avatar for Ancient Dragon
0
105
Member Avatar for guitarrick

Stuck again. Determines the size of the green crud population on any given day. // Assumes that green crud reproduces every 5 days starting when // it is 10 days old,giving a growth rate following the Fibonacci sequence. // So if there is a new crud population of 10 pounds …

Member Avatar for Salem
0
105
Member Avatar for michaelmac

Hi I am use to using the old c/c++ system("dir") in the 16-bit world. how do I use it in the vc++ express 2008 world? Thanks

Member Avatar for michaelmac
0
134
Member Avatar for np2100

I am working on a program that scans a host and I ve run in to a simple problem I cant figure out. When it asks what type of scan to perform and you say number 2 it will go to the number 1 type of scan. Here is the …

Member Avatar for WaltP
0
87
Member Avatar for Icebone1000

hi, sorry my english im using visual studio 2005, my project is in win32 console application im training to use files, my problem is that i cant do a ifstream get all stuff of a .txt file, it get just the first line, i can do put all in the …

Member Avatar for Icebone1000
0
88
Member Avatar for eXceed69

Our servers is crashing everytime when my client scan my ports. And due minimal documentation since the code is writen few few years ago the only thing I could do is just recreate the whole event. below are the piece of the function that error and its exception tells that …

0
86
Member Avatar for kafkas

I need to find the 5 middle numbers in the center(example: 2 3 4 5 6 7 8, the middle numbers are 3 4 5 6 7, remove+subtract largest and smallest numbers), I have tried many ways but have not succeeded. Can anyone please help me? [code]#include <iostream.h> #include <iomanip.h> …

Member Avatar for invisal
0
173
Member Avatar for moe1983

[B][U][COLOR=#000000]part iII: project[/COLOR][/U][/B] [B][U][COLOR=#000000]Problem 1[/COLOR][/U][/B] [COLOR=#000000] [/COLOR] [COLOR=#000000]a- Compute the median of a data file. The median is the number that has the same number of data elements greater than the number as there are less than the number. For purposes of this problem, you are to assume that the …

Member Avatar for Andre79
0
268
Member Avatar for eranga262154

Hi all, I'm working with some date formating, with local and UTC time format. At the end I've print the result to the console as follows. [CODE] cout << stLocal.wMonth << "/" << stLocal.wDay << "/" << stLocal.wYear << " " << stLocal.wHour << ":" << stLocal.wMinute << "\n"; [/CODE] …

Member Avatar for eranga262154
0
140
Member Avatar for dougy83

Hi, I recently read that memory leaks can occur when using the string stream str() member function ([url]http://www.troubleshooters.com/codecorn/memleak.htm)[/url]. Is this true only for passing pointers or references to the created string object? Is this true at all? For example, can anyone see if the following code would cause a leak …

Member Avatar for dougy83
0
2K
Member Avatar for technogeek_42

who can help me to derive this C++ codes to VB that can draw the triangle [CODE=c]#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> main() { clrscr(); float a,b,c,S,D,A,B,C,Area,R; printf("Enter the lengths of the three sides of the triangle : "); scanf("%f%f%f",&a,&b,&c); S = (a+b+c)/2.0; // S is the semiperimeter of the triangle D …

Member Avatar for technogeek_42
0
229
Member Avatar for Barefootsanders

Hey everyone, I'm attempting to write a program that will pipe and fork to have a parent and child process. Then the parent writes numbers to the pipe and the child either multiplies or divides the two numbers. For some reason my file I/O isn't working. It's supposed to keep …

Member Avatar for WaltP
0
98
Member Avatar for tootypegs

Hi my problem is as follows. I want to stream a certain amount of bytes from usbimage2.txt until my buffer is full then write them to new.txt. My first problem is my buffer. If i give the buffer a value of say '4' it compiles with no errors. However i …

Member Avatar for Duoas
0
85
Member Avatar for kv79

Hi a have a problem. [code=cpp] //BUTTON CONTROLS - Copyright © 2000,2005 Ken Fitlike //============================================================================= //API functions used: CreateWindowEx,DefWindowProc,DispatchMessage,GetMessage, //GetSystemMetrics,LoadImage,MessageBox,PostQuitMessage,RegisterClassEx, //SendMessage,ShowWindow,UpdateWindow,TranslateMessage,WinMain. //============================================================================= //This demonstrates the creation of the following button types: default push //button,push button,check box,radio button and groupbox. The image style of //'bitmap' buttons (BS_BITMAP) and 'icon' buttons (BS_ICON) …

Member Avatar for Duoas
0
555
Member Avatar for kv79

Hi ,i just have a fhew code witc i do not understand clear.Can you make some explain. It is category from C++ Win32 API. [code] typedef std::basic_string<TCHAR> ustring; inline int ErrMsg(const ustring& ); What this mean ustring& ? [/code] [code]ustring classname=_T("SIMPLEWND"); ErrMsg(_T("Failed to register wnd class"); [/code] // And i …

Member Avatar for kv79
0
173
Member Avatar for sana_akram

can we send the input from command prompt screen to the text file in C++ if anyone know plz tell me about it briefly

Member Avatar for WaltP
0
108
Member Avatar for mrjoli021

I cant get the program to compile I am getting 'system': identifier not found I have the following includes #include "stdafx.h" #include "Email.h" #include <iostream> #include <fstream> #include <String> #include <cstdio> #include <stdlib.h> [code] #pragma once using namespace System; namespace Email { public ref class Class1 { private: void telnet …

Member Avatar for Duoas
0
242
Member Avatar for mr.cool

hi, i need help with how to find the max number and min number from an array. there are 31 numbers, i know that i am suppose to use a for loop to do this and this is what i got so far array is inputed by user [code] #include …

Member Avatar for mr.cool
0
111
Member Avatar for HLA91

Hi all I was looking for a port scanner to see what was open on my laptop and I thought as I was learning C++ why not search for a C++ port scanner. I came across this code I can make sense of most of it but it wont compile. …

Member Avatar for Duoas
0
1K
Member Avatar for mrjoli021

I am having some isues adding std as a namespace. I am using vs2008. don't know if that has something to do with it. [code] #pragma once //using namespace System; using namespace std; namespace Email { public ref class Class1 { private: void telnet () { system("dir"); } }; } …

Member Avatar for Duoas
0
587
Member Avatar for uthnim

helllo everyone, i am writing a C++ program using ifstream. There will be two text file_ one with balance of the customer's account, and the other with the customer's purchase. Just like this. 100 1000.00 101 2000.00 102 3000.00 103 4000.00 the above is the balance.txt with customer nos (100 …

Member Avatar for Duoas
0
140
Member Avatar for mrjoli021

I am new to c++ classes. I am trying to write a simple e-mail class. below is my .h file. In the cpp all I have is the main which is empty right now since it wont even compile. I am getting cout and endl as an undelclared identifier. I …

Member Avatar for mrjoli021
0
197
Member Avatar for tehprince

I have the following program I need to write: I need to read in a line of text and then output a list of all the letters that occur along with the number of times each letter occurs. An array with a struct type as its base must be used …

Member Avatar for VernonDozier
0
150
Member Avatar for mrjoli021

I am writing a program that requires me to call certain dos commands. I am using the system function like: system("attrib -h"); when I try to compile it I get error C3861: 'system': identifier not found I am using vs2008 any ideas did the command change??

Member Avatar for mrjoli021
0
109
Member Avatar for wijitha

hi all.. Can any one explain, when i have class Pet, what is the difference of declaring variables like each of following. Pet mypet; Pet mypet = new pet(); Pet* mypet = new Pet(); thanks.

Member Avatar for invisal
0
91

The End.