49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
[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 … | |
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() ) … | |
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] | |
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 … | |
Hey guys I'm in 11th std and we are supposed to do a C++ project on a topic called FUNCTIONS.What are they? | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 -------------------- … | |
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 . | |
[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 … | |
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 … | |
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 # … | |
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] | |
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* … | |
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. … | |
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 … | |
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 … | |
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), … | |
how can we create a password and change the password? thank you!! |
The End.