51,593 Topics

Member Avatar for
Member Avatar for jaepi

Hello there, just a question, what do you think is the purpose of this flag to this block of code... [code=c++] void CDriveControl::Trace(bool bAt, char *lpszFormat, ...) { #ifdef _DEBUG va_list args; va_start(args, lpszFormat); printf(lpszFormat, args); if( bAt) { fflush( stdout); } va_end(args); #endif } [/code] I've been wondering, why …

Member Avatar for jaepi
0
201
Member Avatar for meiyantao

This codeblock comes from Mr Weiss's book "Data Sturucture and Algorithm Analysis in C++"(Third Edition). I have some questions about it. [code=c] /** *This is a member function from the BinarySearchTree class. *And It try to find whether there's a element equal to x in *the binary search tree. */ …

Member Avatar for WolfPack
0
174
Member Avatar for bops

How would you colour a control, for example colour the background of a button control to Black and the text of the button control to white... [CODE] HWND hButton = CreateWindowEx(0,"BUTTON","&Send",WS_VISIBLE | WS_CHILD,230,100,70,20,hwnd,(HMENU)cmdBUTTON,0,0); if ( hButton == NULL ) { MessageBox(hwnd,"Error: button could not be created","Error",0); } /*Change the colour …

Member Avatar for vijayan121
0
220
Member Avatar for alex130

Hi, I'm using windows XP and trying to simulate mouse movement and mouse clicks. The following code supposed to move mouse to absolute position (100,100) and perform a click: //test.cpp file: [CODE]#include "stdafx.h" int main(int argc, char* argv[]){ INPUT *buffer = new INPUT[3]; //allocate a buffer buffer->type = INPUT_MOUSE; buffer->mi.dx …

Member Avatar for uglinho
0
5K
Member Avatar for Matt Tacular

How can I make a pointer to an array? So that I access the members of the array by using the pointer in a seperate function. I'm wondering because I have an array I have to access in functions other than the one it was defined in, but I need …

Member Avatar for Matt Tacular
0
332
Member Avatar for jaepi

Hello there, I've encountered a syntax in one of the examples I'm studying. [code=c++] *pStatus = *pStatus | DC_ST_DISK_IN | DC_ST_TRAYCLOSE | DC_ST_WRITING; //<--notice the "|" [/code] Is this a form of piping? Like in bash script in Linux which supports piping in there commands? uhmmm.. What does it imply, …

Member Avatar for jaepi
0
171
Member Avatar for blueskylvr7

ok so I'm very new at classes and don't quite understand them much so this may seem simple. What I have to do basically is write a program that takes in an angle (for example 149degree symbol34.8' W) and then prints it out on to the screen. I have to …

Member Avatar for thekashyap
0
97
Member Avatar for alembic21

Hello All, Here are the instructions for the program I am trying to write: > Write a program that determines which 2, 3, and 4 digit #'s are equal to the sum of the cubes of their digits. > Ex. > if the original # is 234, determine if (2 …

Member Avatar for ndeniche
0
135
Member Avatar for joesmithf1

Hi All, I have been pulling my hair out trying to figur out this problem. Please help!!! I just started C++ Thank you! Joe I need my output to look like this: The original vector v[] is: v[] = { 1.05 -2.55 1.75 1.10 -0.75 2.43 -3.55 4.19 1.45 -0.05 …

Member Avatar for ndeniche
0
59
Member Avatar for jaepi

Hello there, I've been googling around about the definition of SPTI (SCSI Pass-Through Interface). It is somehow related to c++ since it is use to manipulate a drive using the c++ language. Is someone here knows the definition of SPTI, or simply explain to me briefly what it does. Thank …

Member Avatar for jaepi
0
162
Member Avatar for radskate360

Hi, Im a beginning C++ student and having a very tuff time, but I have been trying for a few hours, and wanted come to you guys with my questions. I have been working on this school project and have figured out every step but two. Can anyone please help …

Member Avatar for radskate360
0
117
Member Avatar for blazted

I have a binary tree and I am having problems with one function. It is my add function where I add another node to my tree. I use recursion to call it from within the function. I believe I am not using the correct syntax to call the node from …

Member Avatar for blazted
0
133
Member Avatar for Matt Tacular

I'm making a program where there is a function that asks how many players there are, and depending on the answer, it makes an array of classes that size. How can I access the array of classes from other functions? I thought I would just make it global, but how …

Member Avatar for Narue
0
124
Member Avatar for kinggarden

[LIST] [*][quote]Write a program which finds the factorial of a number entered by the user. (check for all conditions) (Beginner).[/quote][/LIST][code=C++] void findfactor(const unsigned int number) { unsigned int n = number; printf("The factors ot the input number are:\n"); if (0 == n) { printf("%d\n", n); return; } for(unsigned int i …

Member Avatar for Narue
0
121
Member Avatar for MrMan2787

i am trying to write a program that takes information from a file and reads it and then does some kind of encryption, simple as adding one to it I have it reading the file, but how would i go about readings the characters as int's and then adding a …

Member Avatar for Ancient Dragon
0
105
Member Avatar for ongxizhe

Hey all. Does anyone knows where to get some good tutorials of programming C++ Graphical User Interface? If so, please kindly send a PM and include your contact or reply here. Your help willl be appreciated. Thank you. Xizhe

Member Avatar for ongxizhe
0
381
Member Avatar for Matt Tacular

I need to set up 2 buttons to take input from the user, that increase and decrease a variable, it doesn't matter which 2 buttons are used, but preferably the up and down arrows. And I also need to have a display of the variable that constantly updates as it …

Member Avatar for Opo
0
150
Member Avatar for Matt Tacular

Is there a way to make a loop that creates strings? I ask the user how many players there are, and then the loop makes that many strings in order to get all of their names... Something like this, (but not in normal english...): [code]cout << "How many players? " …

Member Avatar for Ancient Dragon
0
107
Member Avatar for jaepi

Hello there. I have here a constructor of class CDriveControl and class CSPTIDriver.. [code=c++] class CSPTIDriver; class CDriveControl{ public: CDriveControl(); CDriveControl(const char* pPort); ...... ...... protected: char* m_pPort; CSPTIDriver* m_pSPTIDriver; bool m_bInitFlag; bool m_onlycomp; } [/code] It was defined outside the class. [code=c++] CDriveControl::CDriveControl(void) :m_pPort(NULL) //Object drive ,m_pSPTIDriver(NULL) //SPTI object …

Member Avatar for jaepi
0
305
Member Avatar for meiyantao

I don't ensure whether "0" or "NULL" is better to be an empty point's value in C++. Could anybody can tell me,and why? Then how about it in C, why? Thank you!

Member Avatar for Narue
0
148
Member Avatar for Matt Tacular

Can anyone tell me why this doesn't work? I know it's probably really easy, but I did try.... [code]/* ISU program created by Matt in grade 12 programming. */ #include <iostream> #include <list> #include <iterator> using namespace std; class humanPlayer { public: humanPlayer(char thePlayersName, unsigned int thePlayersTurnNum); //constructor ~humanPlayer(){}; void …

Member Avatar for Narue
0
116
Member Avatar for Matt Tacular

When using an STL list, how can I check if a certain variable happens to just be in there? Basically, given this already: [code]#include <iostream> #include <list> #include <iterator> using namespace std; list<int> integer_list;[/code] I need a way to code this in C++: [code]if(x is in integer_list){ do this }[/code]

Member Avatar for Matt Tacular
0
99
Member Avatar for Daan

Hi, I'm trying to use a program, written by others, that has C/C++ code compiled as part of its setup procedure (it's called Content - integrated environment for the analysis of dynamical systems). However, c++ (or g++ actually) complains about invalid conversions and cannot compile: [code]autodif.c: In function ‘char* Mult(char*, …

Member Avatar for vijayan121
0
143
Member Avatar for Daco

hey everyone, im making a program that controls my cube using GCNRD. but shellexecute is being a tard to me the code should work like this: enter a value and the program starts gcnrd to poke the value i got that in these lines [code=cplusplus] string CButton; string CoButton; cout …

Member Avatar for Daco
0
153
Member Avatar for kinggarden

Hi, everyone. I have worked in IT field for about 1 year, before that my major was physics. So I feel I'm just a new guy in this field, and I hope you could help me:) Now, I work in a embedded C++ project on WINCE platform. I'm not very …

Member Avatar for kinggarden
0
128
Member Avatar for Eko

I'm looking for a C++ book with exercices(solved),practice or something like "tips and trips of c++ language" cause I need to prepare for the exam. If someone know's a kind of this book , pls reply.I searched google , but didnt found what i want

Member Avatar for Narue
0
130
Member Avatar for nedwards

I was wondering by using the Visual Studios 2005 and Windows XP could you write code in C# and add some other code in C++? What is happening is that I am updating this program that was previously made in C# and I need to add some security functionality, although …

Member Avatar for nedwards
0
140
Member Avatar for tech291083

Hi, I am on Fedora Core 5 32+bit and learning standard C++ (not VC++) on my own using the terminal only and not any particular IDE. Is it possible to write and compile a small C++ program that can create very basic types of graphics in a terminal? Not sure …

Member Avatar for John A
0
54
Member Avatar for sundar divas
Member Avatar for bops

Hi, I want to very simply give a specific control a specific font when creating a GUI. For example, I would like a multiline edit text control to have a courier new font. I have been searching for hours and can't really make much sense of what I am looking …

Member Avatar for WolfPack
0
70
Member Avatar for fahima.s

I want to write a server side application for Pocket PC. I wrote it in eVC++ by deriving a class from CCeSocket. But i couldnt accept a connection. How to do socket pgming in PocketPC. My aim is to send messages to pocket pc from desktop application when an event …

Member Avatar for jbennet
0
38
Member Avatar for sundar divas

Program received signal SIGSEGV, Segmentation fault. 0xff2209e8 in _write () from /usr/lib/libc.so.1 (gdb) up #1 0xff212bf4 in _xflsbuf () from /usr/lib/libc.so.1 (gdb) up #2 0xff21000c in _flsbuf () from /usr/lib/libc.so.1 (gdb) up #3 0x00000037 in ?? () (gdb) up #4 0x00000037 in ?? () (gdb) up Previous frame identical to …

Member Avatar for vijayan121
0
105
Member Avatar for castegna

I need to do a non-recursive function for count the leafs in a tree. I have the recursive algorithm, Can someone help me to figure this out!! count leafs int count_Lnodes(root, int cnt) { if (root != NULL) { cnt = count_Lnodes(root->left, cnt); cnt = count_Lnodes(root->right, cnt); if (root->left == …

Member Avatar for Narue
0
127
Member Avatar for Covinus

warning C4273: 'fileHandle::fileHandle' : inconsistent dll linkage. dllexport assumed. what does this warning mean? during debug i dont get this message but during release i have this one. can anyone explain the message to me and maybe give some remedy to it

Member Avatar for Ancient Dragon
0
486
Member Avatar for quintoncoert

I am using VC++ express edit 2005 but I can also switch to C# 2005 express. I would like to know if there is a cmd similar to the shell function which is found in visual basic. The VB shell cmd basically allows one to execute a dot exe file …

Member Avatar for Nick Evan
0
211
Member Avatar for complete

What is the difference in these two lines? #define X 100 const int Y 100; Apart from the fact that one is for X and the other is for Y (har har, very funny) effectively don't they do the same thing? Why would one be preferable over the other?

Member Avatar for vijayan121
0
121
Member Avatar for Sir_BigOne

Making a "hello" world program in VC++ 6.0 is cool, as I got a very happy feeling when i completed it... but reading alot of books to learn "a round about" way in something isn't me. I'm objective oriented. What materials should I, could I, get my hands onto learn …

Member Avatar for Covinus
0
99
Member Avatar for machine

Hi, Trying to overload - and getting this error. I am not sure why.. error C2447: missing function header (old-style formal list?) [code] #include<iostream.h> #include<string> #include<new> #include<ctime> using namespace std; class D { public: D operator- (const D &d2); }; D D::operator- (const D &d2); { //error points to here!! …

Member Avatar for machine
0
250
Member Avatar for jaepi

Hello there, I just want to ask if any of you guys here had experienced writing hardware controllers (dvd-rom, hard disk) using scsi protocol-multimedia commands. I just want to know your suggestions or maybe tutorials or example codes to well experienced in mmc (both windows and linux :)) that would …

0
57
Member Avatar for Woody714

I'm fairly new to C++ and have an assignment that is knocking me out. The text file is fairly simple: Plain Egg 1.45 Bacon and Egg 2.45 Muffin 0.99..... etc.... And the code is: [code=c] //Breakfast Billing System //Marlen LaBianco //May 20, 2007 //Program to calculate a local restaurant's breakfast …

Member Avatar for John A
0
926
Member Avatar for Matt Tacular

**I know the code looks big, but it's a very small isolated section at the bottom (starting at line 164) that's giving me the problem.** When this program is run, when I try to open the file I just appended some text to, it doesn't open... can anyone spot why? …

Member Avatar for Salem
0
149
Member Avatar for faisaly

Dear All, Please help me regarding this C++ Assignment. Q.1 [COLOR=green]Write a program using [B]malloc[/B] function. In which you take input from user and allocate memory equal to square of this number. Which multiply numbers and draw a table in the following format?[/COLOR] [B][COLOR=green]Hint: User enters 3 then program allocates …

Member Avatar for Salem
0
107
Member Avatar for MrMan2787

Hi all, I have a QUESTION regarding [B]data validation[/B] I'm writing a program, where i want the input to be [U]only integers[/U]. so if they enter things such as letters or symbols it won't crash my program. i tried stuff like, while(inputArray[count] != int) { cout << "Invalid Input. Please …

Member Avatar for Ancient Dragon
0
180
Member Avatar for wujianwei

here's the description: ============================================= You are asked to develop a C++ program that reads a text ¯le given by the user (e.g. test.txt), and output the frequency of the prepositions contained in the text ¯le on the screen. Your program shall provide a simple interface for the user to input …

Member Avatar for Ancient Dragon
0
120
Member Avatar for ledox

hi, i have a another question about converting char to int in C++. if i have [U]char n="123[/U]" and [U]char n2= "87"[/U] and i wanna sum those two char...how can i do that? i know i have to [COLOR=green]change[/COLOR] each [COLOR=green]char[/COLOR] in [COLOR=green]int [/COLOR][COLOR=green]but for the rest...[/COLOR] thank

Member Avatar for blazted
0
92
Member Avatar for CRD

this loop will not exit when n is pressed I sure would appreciate a clue as to how to exit a loop. here is the code. code [COLOR=green]// Ex3_12.cpp[/COLOR] [COLOR=green]// using a while loop to compute an average[/COLOR] [COLOR=green]#include[/COLOR][COLOR=green]<iostream>[/COLOR] [COLOR=green]using[/COLOR][COLOR=green] std::cin;[/COLOR] [COLOR=green]using[/COLOR][COLOR=green] std::cout;[/COLOR] [COLOR=green]using[/COLOR][COLOR=green] std::endl;[/COLOR] [COLOR=green]int[/COLOR][COLOR=green] main( [/COLOR][COLOR=green]void[/COLOR][COLOR=green] )[/COLOR] { …

Member Avatar for ~s.o.s~
0
69
Member Avatar for meiyantao

I don't know how to sparate the interface and their implement.And I need some help from you.For example,I hope anybody can tell me,how to make these three files to work well. [CODE] //This file named main.cpp #include <iostream> #include "ABC.h" using namespace std; int main(void) { char y='y'; char e='e'; …

Member Avatar for meiyantao
0
169
Member Avatar for ITech

hello guys, can anyone recommend me a site or alink for agud e book in learnin c++..startin from basics to advance...i have a very clear picture of C and data structures using C...

Member Avatar for vijayan121
0
187
Member Avatar for ghadahelal

hi all have anyone any idea how can i make my program read 3 or 4 files ,in a folder. i mean my input isn't only one file, it's a folder. can the C++ do that?

Member Avatar for ghadahelal
0
138
Member Avatar for CRD

Using Visuel Studio 2005 and the choices I have are as follows Could someome help me to understand what they are? ALT CLR General MFC SMART DEVICE WIN32 Any help to clarify what these choices mean would be Appreciated. Thank you Dick

Member Avatar for CRD
0
147

The End.