49,761 Topics

Member Avatar for
Member Avatar for Chuckleluck

I'm having trouble using the CreateFile() and WriteFile() functions. Here's the code I've written: [CODE]#include <windows.h> #include <iostream> using namespace std; int main() { char cData[6]; DWORD dwBytesWritten; cout << "Please enter a number: "; cin >> cData[1]; for(int i = 2; i < 5; i++) { cout << "\nPlease …

Member Avatar for Chuckleluck
0
202
Member Avatar for soccermiles

I would like to embed the python interpreter, but not in the way most other people do. I don't need to multi-thread unless it's necessary to do as follows... What I need is control over when execution happens. More specifically, I would like to use a python script to call …

Member Avatar for soccermiles
0
264
Member Avatar for mikecolistro

HI there! So ive been looking around on how to reset the function clock() and the examples ive found have not worked, basically in my code i have to loops, the first i want to run for 15 mins then the inner loop run for one, so i assigned a …

Member Avatar for nezachem
0
303
Member Avatar for stereomatching

compiler : visual c++ 2010 os : windows 7 64bits learning template and encounter some problem [code] template<typename T> void easyCopyImpl(T const &A, typename boost::enable_if_c< boost::is_array<T>::value>::type *temp = 0) { std::cout<<"this is array"<<std::endl; std::cout<<typeid(T).name()<<std::endl; std::copy(A, A + sizeof_array(A), typename std::ostream_iterator<T>(std::cout, "") ); } template<typename T> void easyCopyImpl(T const &A, typename …

Member Avatar for mike_2000_17
0
165
Member Avatar for WrMadison667

Okay, so I'm new to C++ programming and am working on a simplified project to find Expected taxable income. The project states that I have to set SI, HH, MJ, and MS as const int variables equal respectively to 5700, 8350 11400, and 5700. const int SI = 5700; const …

Member Avatar for Fbody
0
140
Member Avatar for valestrom

Hey, I'm looking for an IDE with .NET capabilities, but not visual studio. As I need it to run off a flash drive. Any suggestions?

Member Avatar for pseudorandom21
0
163
Member Avatar for maybnxtseasn

[CODE]class Cents { private: int m_nCents; public: Cents(int nCents=0) { m_nCents = nCents; } // Copy constructor Cents(const Cents &cSource) { m_nCents = cSource.m_nCents; } };[/CODE] will the copy constuctor still work properly if i had decided to implement it was follows [CODE]class Cents { private: int m_nCents; public: Cents(int …

Member Avatar for Fbody
0
92
Member Avatar for Tom_Weston

I have no idea how this would be done, but how would I check the amount of line that exist in a text file. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("example.txt"); if (myfile.is_open()) { while ( myfile.good() ) …

Member Avatar for L7Sqr
0
99
Member Avatar for l0v3csci

Having trouble computing the number of occupied neighbors each cell in the array has. Any help would be greatly appreciated. [CODE] Array[rows][cols-1] Array[rows+1][cols-1] Array[rows-1][cols] Array[rows][cols] Array[rows+1][cols] Array[rows-1][cols+1] Array[rows][cols+1] Array[rows+1][cols+1] [/CODE]

Member Avatar for Fbody
0
8K
Member Avatar for ChaosKnight11

Hi, I started with C++ development recently, and I think I'm ready to start building GUIs for my apps. I'm thinking about using Qt, since it is the most popular C++ GUI library, but the licensing is really confusing, and there isn't a lawyer nearby that understands software licensing who …

Member Avatar for Stefano Mtangoo
0
325
Member Avatar for meawesome

Hey guys I'm in 11th std and we are supposed to do a C++ project on a topic called FUNCTIONS.What are they?

Member Avatar for Ancient Dragon
0
70
Member Avatar for DoubleZ

Hello guys! Basically I have this basic homework, the program must check if the digit sum of one of the 3 inputted integers is equal to the difference of 2 others. So if A = 56, B = 33 and C = 22, the program should output 56, cause 5+6 …

Member Avatar for DoubleZ
0
326
Member Avatar for _electricblue

[CODE]#include <iostream> #include <fstream> using namespace std; int underPopulation; // Any cell with less than <underPopulation> liviving neighbors dies. int overCrowding; // Any cell with more than <overCrowding> living neighbors dies. int minNeighborsToLive; // Any cell with <minNeighborsToLive> living neighbors lives. int reproduction; // Any dead cell with <reproduction> living …

Member Avatar for Fbody
0
896
Member Avatar for ajayb

I am trying to do remote function call in c++. The scenario is like this. There are two programs running say P1 and P2. P1 is trying to call a function implemented in P2. The program P1 calls a function using an object which will make a call to a …

Member Avatar for sundip
0
343
Member Avatar for dsiyekd

I need to use the comm port to control an equipment. In order to get some initial information about the equipment, I need to "Send" and "receive" several commands to the equipment automatically at the beginning of the program. I've tried several Serial Classes from the internet, even the MSComm …

Member Avatar for sundip
0
144
Member Avatar for Cyber-SEO

I've been working with an older programmer who's coding an IVR solution. It's running on Windows 2000 and is connected to a T1 (we have internet access) through the machine his code is running on. I've been trying to get him to request information from our main web server via …

Member Avatar for vasava
0
826
Member Avatar for jesz

Write a program that computes XN where X is a floating point number and N is a positive integer. The program informs the user that N must be positive if the user enters a negative value. Of course, XN = X * X * X * ... * X -------------------- …

Member Avatar for Moschops
0
112
Member Avatar for GottaLove

Hi , Assuming I have a text file containing numbers , exp : 1_234 And i want to store 1 as int ID1, 234 as ID2. How can I skip underscore "_" ? ifstream infile; infile >> ID1 >> ID2 , ??? I'm still not sure Thanks .

Member Avatar for WaltP
0
159
Member Avatar for lolwaht
Member Avatar for hujiba

[CODE]#include <iostream> #include <iomanip> #include <cmath> #include <fstream> #include <string> #include <vector> #include <cstdlib> using namespace std; /** Test case 1: test words that start with a vowel. When inputting the words air and ear, then outputs are airay and earay. Test case 2: test words that start with a …

Member Avatar for hujiba
0
119
Member Avatar for trantran

This is a frustating problem likely experienced by everyone and therefore there (might) be now a "perfect" solution, but my limited skills have impeded me from finding it. 1) I created a plain vanilla text_class that automatically relocates itself when needed. 2) I want to use my text_class with Win32 …

Member Avatar for mike_2000_17
0
99
Member Avatar for cijeh90

Purpose: To practice writing a simple well-documented (lots of comments) C++ program using repetition structures (loops). Assignment: The power of a repetition structure lies in the fact that a section of code can be executed several times (often using different data) in the same program run. Modify, Laboratory Assignment # …

Member Avatar for azwan91
0
310
Member Avatar for Tom_Weston

I was just wondering, how to check how many 't's there are in the sentence? [CODE] #include <iostream> #include <string> using namespace std; int main() { string test = "The man played with the ball in his backyard."; return 0; } [/CODE]

Member Avatar for mrnutty
0
102
Member Avatar for trantran

It seems easy to make sure that an object can only be created on the stack and not on the heap (by simply marking private operator new), but is it possible to do the opposite: only permitting the creation of an object on the heap (with operator new) and *not* …

Member Avatar for mike_2000_17
0
164
Member Avatar for Zssffssz

I am MAD. Google was useless in this sense. I want to make a header file/ external reusable .cpp. AND I WANT EVERY LITTLE DETAIL. I just can't find anything. I just want to put a few functions I use all the time in it. PLEASE... Great now I'm sad. …

Member Avatar for Zssffssz
0
137
Member Avatar for LevyDee

Ive been trying to understand this subject for two days now, but can't seem to get it working. My setup is two consoles, a Server console, and a server message board console. The Server message board is a child process of my Server console. The Server will send messages to …

Member Avatar for LevyDee
0
202
Member Avatar for infoJUNKIE121
Member Avatar for totalanonymity

Goals of exercise are: [LIST=1] [*]Output the value of PI (3.1419, as per exercise). [*]Prompt user to enter radius, r, and store it. [*]Calculate surface area of sphere: 4 * PI * r ^ 2 [*]Calculate volume of sphere: (4/3) * PI * r ^ 3 [*]Output the surface area …

Member Avatar for WaltP
0
3K
Member Avatar for PixelExchange

Does anyone know any good resources where one could learn GDI+ (Gdi plus) with the Win32 api? There are many resources for learning Gdi+ with MFC, but not with win32. I tried learning gdi plus with win32 on my own, but ran into the following problem: [CODE]Graphics graphics(hdc); Pen blackPen(Color(255,0,0,0), …

Member Avatar for PixelExchange
0
129
Member Avatar for leefuren

The End.