51,593 Topics
![]() | |
[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 … | |
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 … | |
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.. | |
[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] | |
hey! friendz plz tell me how to insert time in a running programme ,which is similar to system clock time. | |
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 … | |
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 … | |
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) … | |
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 … | |
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... … | |
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 … | |
[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 … | |
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 … | |
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. | |
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 … | |
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 | |
Hi guys. Is there a Forum or Section that deals with windows programming in C++? | |
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". | |
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. | |
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 … | |
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 … | |
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... | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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> … | |
[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 … | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) … | |
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 … | |
can we send the input from command prompt screen to the text file in C++ if anyone know plz tell me about it briefly | |
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 … | |
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 … | |
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. … | |
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"); } }; } … | |
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 … | |
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 … | |
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 … | |
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?? | |
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. |
The End.