49,761 Topics

Member Avatar for
Member Avatar for hystaspes

Is there any drawbacks for using "this" pointer? For example: [CODE] Window_Properties::Window_Properties(wchar_t* wnd_title, wchar_t* wnd_class_name): window_width(1280), window_height(720), window_X(0), window_Y(0) { this->window_title = new wchar_t[ wcslen( wnd_title ) ]; if( this->window_title ) { wcscpy( this->window_title, wnd_title ); } this->window_class_name = new wchar_t[ wcslen( wnd_class_name ) ]; if( this->window_class_name ) { wcscpy( …

Member Avatar for hystaspes
0
121
Member Avatar for svatstika

Hello everyone! I'm writing a program to evaluate an infix expression(for example: 1.5*(2-3)+(4.5-4)). To do that I'm using function void infix2postfix(char* infix, char * postfix, int insertspace) to convert an infix expression to the postfix one (for this purpose I'm using a stack to hold operators of infix expression); then …

Member Avatar for VernonDozier
0
257
Member Avatar for monty2831

Hi, i have no idea how to go about doing this iv tried coding it a bit but just get very confused! if anyone could give me a hand or show me some sample code would be great. Thank you Create a program which: Implements a class called Queue: The …

Member Avatar for jonsca
0
109
Member Avatar for chubzyko

Guys, I really really need a hand on this simple problem that I think, for me, is a really really big problem. I'm using the compiler turbo C. I have all the codes working except that it does not go back to the main menu. Can you please check my …

Member Avatar for Clinton Portis
0
128
Member Avatar for rhoit

[CODE] #include <iostream> int main() { for(int i; i<3; i++){ volatile char str[]="hello\n"; std::cout<<str<<std::endl; } return 0; } [/CODE] Why? its gives output [ICODE] 1 1 1 [/ICODE]

Member Avatar for rhoit
0
531
Member Avatar for Tiancailee

okay, so i do not understand the building of a link list although my professor has explained during my tutorial before. I cant get the concept of insertion a node and deletion of a node. i tried building a linked list myself which is mostly memorised from books. therefore can …

Member Avatar for Narue
0
126
Member Avatar for zealqueen

1. * * * * * * 2. * * * * * * 3. * * * * * * * * * 4. * * * * * * * * can someone please send me the c++ codes for these four inputs

Member Avatar for muze
-3
109
Member Avatar for "roja"
Member Avatar for hoceandress

how to assigned comma and period in thousand number?? (ex. 1,000.50) in c++.. this is my sample code... [code]#include <iostream> main () { int x=0,y; cout<<"Coverting Dollar to Philippine Currency:"; cout<<"\n\nEnter amount of dollar: $ "; cin>>y; x = y * 45.00; cout<<"Php "<<x; return 0; }[/code] i want to …

Member Avatar for ZirNes01
0
4K
Member Avatar for muze

hello guys.... I am making small TAPI prof which tells about the incoming of the calls. - When first time I call, it detects the incoming call. - But when I drop the call and Call again, it does not detects it. here is small code that is responsible for …

0
65
Member Avatar for nocluewhattodo

Hi, I'm new to c++ and programming all together and I really need help. So what I had to do was display a table showing the medals earned by several countries at a certain competition and their total medal count. Then I'm asked to write a function which returns the …

Member Avatar for SgtMe
0
306
Member Avatar for qvyhnl

Problem: Write the program columns that takes three command-line arguments. The first is the file to open, the second, the file to write to, and the third is the number of characters to display on each line. Read the input file, character by character, echoing to the output file, inserting …

Member Avatar for qvyhnl
0
143
Member Avatar for claudiordgz

Hi guys, I want to build a DLL to access classes and functions from a Visual Basic program This right here is my class [CODE] class SimpleDevice : public IHaptikDevice { private: // Callback Related PVOID object; PVOID method; UINT32 timerId; // State HaptikData data; HaptikUserData userdata; public: static Vector3 …

Member Avatar for claudiordgz
0
144
Member Avatar for jasleen12345

i have the following code...according to my book both the files should open...but it opens both the files...writes into them....but when i open them for reading....only one opens up....pls see where i am wrong....[CODE] #include<iostream> #include<fstream> using namespace std; int main() { ofstream fout; fout.open("country.txt"); fout<<"United States of America\n"; fout<<"United …

Member Avatar for jasleen12345
0
172
Member Avatar for chode1

11/29/2010 S 2907 1 11/29/2010 S 9673 4 11/30/2010 A 4321 30 11/31/2010 S 9673 12 12/01/2010 N 5789 wind_chimes 13.54 17.83 12/02/2010 S 5140 5 I have string date, char type and int id, processNumber. myfile>>date>>type>>id>>processNumber; does not work..what should i do?

Member Avatar for Clinton Portis
0
78
Member Avatar for Tiancailee

Hi i was given an assignment that ask me to create a simple object viewer. These are the requirements: 1. Display simple objects such as cubes, cylinders, pyramids, etc. 2. Objects should be able to rotate around all 3 dimensions. 3. There should be a parent object class from which …

Member Avatar for Tiancailee
0
177
Member Avatar for crimes

[CODE] #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { int x; cout << "Press the number 1, 2 ,or 3"; cin >> x; while (x!=1){ cout<<"Please try to pick a difference selection."; cin>>x; } if ((x==1) { cout<<"\nYou chose ";cout<<x; } system("PAUSE"); return 0; } [/CODE] …

Member Avatar for crimes
0
143
Member Avatar for VilePlecenta

I am interested in being able to make a C++ win32 program that will simply display someones profile on a phpbb3 forum when they enter in their credentials. I've already made the GUI and other misc code needed for displaying the information, but I dont know how to make the …

0
97
Member Avatar for Meat!

So I am a noobie when it comes to C++, I was wondering if anyone could suggest some resources so that I can learn what is going on?

Member Avatar for chiwawa10
0
86
Member Avatar for newCoder1545

[CODE] /* Write a program which continueously calls a menu function which prints the following menu and returns to main the operation selected: 1.Add 2.Subtract 3.Multiply 4.Divide 5.Compare 6.Quit The menu function must keep printing the menu and asking for a selection, as long as the user enters an invalid …

Member Avatar for chiwawa10
0
117
Member Avatar for chode1

this is my infile's data..How do I get info into various data types? extraction operator? I know extraction works but the 5th line throws me for a loop..Thanks for help; 11/29/2010 S 2907 1 11/29/2010 S 9673 4 11/30/2010 A 4321 30 11/31/2010 S 9673 12 12/01/2010 N 5789 wind_chimes …

Member Avatar for chiwawa10
0
95
Member Avatar for flukebob

I need to build a Windows program with Visual C++ that sends an SMTP email when an alarm condition occurs. I will be reading data out of several PLCs (automation controllers) with the help of active-x controls purchased earlier for other projects. New to Visual C++, (I'm mostly an old …

Member Avatar for flukebob
0
156
Member Avatar for iamthesgt

Hello, I need to take a file filled with numbers and input them into a two-dimensional array. The file would look like: 3 6 3.9 4.5 2.1 1.0 2.4 4.3 3.1 4.2 5.1 6.2 1.0 2.7 1.2 2.3 3.1 4.2 5.2 6.4 where the first two numbers are the vertical …

Member Avatar for iamthesgt
0
179
Member Avatar for emko

Hello, I have to create a graph based program that will validate a zip code given an expression to match eg. ddddd - dddd, where d is a digit 0 - 9. I am new to graphs and don't know how to accomplish this. I'm trying to make graph class, …

Member Avatar for emko
0
123
Member Avatar for hdb25

This is my function that is supposed to take a base ten number and return the same number in a base 16(hexidecimal) format ie. 45 returns 2D instead I am getting 6850 [CODE] string inttohex (int n) { ostringstream buffer; string result; int num; num=n%16; if(num<10) buffer<<(num+'0'); else {buffer<< ((num-10)+'A');} …

Member Avatar for flukebob
0
316
Member Avatar for jsav

I'm new to file I/O in C++ and have encountered a problem. My program checks to see if file "projectdb.txt" exists. If it does, it uses its data to populate an array. If it doesn't exist, it is supposed to create the file. This is where I am having the …

Member Avatar for Agni
0
148
Member Avatar for pmikee

Hi! I have a problem, what i cant solve...I have to write a program, that settles if the most frequent birds peculiar to an area were the same. The number of areas is N. We note the number of the birds. The number of the species is M. I have …

Member Avatar for pmikee
0
144
Member Avatar for jamesl22

I am trying to write some code that reads a file line by line and then outputs the text of each line using cout. Here is what I have so far: [CODE]#include<iostream> #include<string> #include<fstream> #include<sstream> using namespace std; int main() { ifstream input("test.txt"); if (input.fail()) { cerr << "File not …

Member Avatar for Agni
0
176
Member Avatar for hystaspes

This code is from MSDN ([url]http://msdn.microsoft.com/en-us/library/6t4fe76c(v=VS.80).aspx[/url]). [CODE] #include <string.h> class String { public: String( char *ch ); // Declare constructor ~String(); // and destructor. private: char *_text; size_t sizeOfText; }; // Define the constructor. String::String( char *ch ) { sizeOfText = strlen( ch ) + 1; // Dynamically allocate the …

Member Avatar for hystaspes
0
224
Member Avatar for slacke

Hi I am developing an application in Windows environment. I was used to program under linux with Kdevelop and I do miss a feature in the Dev-c++ now. In Kdevelop I can collapse all the functions in my code even the loops and if statements. So when I collapsed all …

Member Avatar for jonsca
0
390

The End.