49,761 Topics

Member Avatar for
Member Avatar for phorce

Hello, wondering if someone can help me quickly.. Basically, I have created a array to store all the data in a text file. The pointer of the array is sent to a function, which then populates it. Here is the code: void Data(char* theData) { ifstream txtFile(inputFile.c_str()); if(!txtFile.is_open()) { cerr …

Member Avatar for Ancient Dragon
0
157
Member Avatar for DeeperShade

I cannot for the life of me see where i'm going wrong. I've got a winsock class, the SOCKET is defined in the Header, but when I try to use it in a function I get a first exception crash. It's ground me to a halt (btw, for anyone who …

Member Avatar for DeeperShade
0
235
Member Avatar for amelia.rox

I am so lost on what to do so please help how ever you can. I must write a program to calculate the cost and time it takes to fill a swimming pool. * Inputs: Length, Width, and Depth of the pool (This is a gross simplification, since pools are …

Member Avatar for WaltP
0
675
Member Avatar for Alochai

Hi, i've been looking around for help with this problem but google seems to just send a load of crap my way so its finally got to the point where i'm asking specifically for help. Here is the code; void CWebRobotDlg::OnBnClickedDologin() { void* pElem= ElemFromID(L"username", IID_IHTMLInputElement) ; IHTMLInputElement* pTextBoxUser= (IHTMLInputElement*)pElem; …

Member Avatar for Alochai
0
645
Member Avatar for Microno

I've written a program that allows you to calculate the definite integral of a function but I feel that it is limited and I want to rewrite it so that the user inputs an equation which is then stored as a string and then that string becomes the equation for …

Member Avatar for Microno
0
165
Member Avatar for hcoyle545

Hi, first of all i'm sorry I didn't include details about the problem i'm having in the title but it feels hard to explain without a wall of text & code for reference, plus the question I have to do for context. **Question** (inb4 dwight schrute) A class called 'sample' …

Member Avatar for phorce
0
275
Member Avatar for james.price.39501

How do I open a Form using a Combobox In C++? How do I open a Form using a combobox? If I have 3 Values such as apples, oranges and I want to open a form if the user choses apples and another form if the user choses oranges. private: …

Member Avatar for Milton Neal
0
272
Member Avatar for funnyguy1

Create a class called Invoice with the properties (Part number, Part Description, Quantity and Price). Create appropriate methods and data types. Use the class Invoice and create an array of Invoice objects (Part number, Part Description, Quantity and Price) initialized as shown below: // initialize array of invoices Invoice[] invoices …

Member Avatar for JasonHippy
0
2K
Member Avatar for jepapel

I have the following code: #include <iostream> using namespace std; int main () { char alphabet[]="abcdefghijklmnopqrstuvwxyz"; char word; cout <<"Please input a word: " <<endl; cin >> word; int res = -1; for (int i = 0; alphabet != '\0'; i++) { if (alphabet == word) { res = i; …

Member Avatar for slumburock
0
4K
Member Avatar for cynusalisa

Hello Guys, I am Confused between the two languages Java and C++ that Which is the better Language to learn? What do You Guys Think about These languages and Can You make difference between these Languages Guys?

Member Avatar for rubberman
-1
233
Member Avatar for Sendy Hipo

hi guys, im learning c++ on my own and i have finished reading and studying E-book by Tony Gaddis ("starting out with c++, from control structures through objects, student value edition, 7th edition ") now im completely "lost" , i have searched google to see reference, but there are too …

Member Avatar for Sendy Hipo
0
141
Member Avatar for ScottFountaine

I'm trying to add a space before and after a user input. I have the space after using strcat() but cant figure out how to put one before. Here is the snippet. void find_keyword() { int len=0; int lenkey=0; int key_no=0; char teststr[50]; while((ip.keyfound==0) && (key_no!=MAX_KEY)) { // getting the …

Member Avatar for ScottFountaine
0
128
Member Avatar for osiron

Hey Guys, I'm trying to create a timer program that is based on the MVC model and I'm having trouble with updating the views via `notify()` function as they should display the number of seconds or minutes and seconds elapsed. Could anyone help me with this problem? //KeyboardController.h class KeyboardController: …

Member Avatar for mrnutty
0
190
Member Avatar for Ghost

When using C++, how do you find the REMAINDER of two numbers and store it in an integer. I think the answer is: [B]X % Y = Int Z;[/B] :idea: Please help. Thanks :lol: , C++

Member Avatar for wangchung
0
939
Member Avatar for XodoX

I can nto find anything that explains semaphores well. From what I understand, you can create an array of the type sem_t , for instance. Like a "semaphore array", I guess. And you use loops somehow to create them. Or can somebody explain this to me, please? I'm trying to …

Member Avatar for XodoX
0
112
Member Avatar for 111100/11000

#include <iostream> #include <cmath> #include <string> #include <cstdlib> #include <cstring> using namespace std; char Outputing(char shifted_letter); int found_match; int searching_alphabet; int main() { const char ORIGINAL_alphabet[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; //maybe const isn't necesery char alphabet[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; cout << "This program encrypts messages using Ceaser Cipher\n"; cout << "\n---------------------------------------------------------"; cout << "\n---------------------------------------------------------"; cout << "\nEnter …

Member Avatar for Labdabeta
0
326
Member Avatar for DeeperShade

Ok, basically i'm putting together a win32 wrapper based on various tutorials I've seen. But when I try to close it via the close buttong (top right) or via the esacpe button it doesn't do anything, with the first it closes the window but doesn't end the program, with the …

Member Avatar for DeeperShade
0
136
Member Avatar for rithish

in java we use import javax.swing when we want to use frame and panel we write like this class frame extends jframe but in c++ we use <iostream.h> and <conio.h> where we use cin and cout from these libraray functions but we dont inherit anything .we use normally we dont …

Member Avatar for Taywin
0
149
Member Avatar for triumphost

How can I compare Dimensional arrays using iterators? My attempt is below but I gave up and used indexing instead. I plan to change comparing doubles with == to use epsilon later. Also should I be using vector of vectors? //In my class, Data is defined as std::vector<std::vector<double>> Data; bool …

Member Avatar for deceptikon
0
184
Member Avatar for senergy

hi, I have trouble with getting info from my table, this is my code: [code]#include "stdafx.h" #include <iostream> #include <mysql++.h> #include <manip.h> using namespace std; #define HOST "" #define USER "senergy" #define PASSWORD "" #define DATABASE "" #define PORT 3306 // deleted info :) int main(int argc, char *argv[]) { …

Member Avatar for godinac
0
487
Member Avatar for daviddoria

For a while now I've been doing this when I want to check the input of a function (in this example, to make sure they are not equal). [code] void foo(int a, int b) { assert(a != b); } [/code] But when the assert fails, I always find my self …

Member Avatar for vibhor48
0
282
Member Avatar for MastAvalons

Hi all! I need to intercept GDI function to save painted screen to hard drive. I have tried Microsoft Detours. Everything is good, but I need 64-bit version (Detours Professional do support but it costs much). Is there any 64-bit alternatives to Detours Professional?

Member Avatar for pipaman
1
325
Member Avatar for Vasthor

this is an unusual error, but maybe if the code presented here it's easier to recognize?! void sLetter(Word_store& s) { for ((s.words_input)::iterator it = (s.words_input).begin(); it != (s.words_input).end(); ++it) tolower(*it); (s.sWords).push_back(s.words_input); return; } the function is aim to converting each character in a string from a member of Word_store into …

Member Avatar for Vasthor
0
155
Member Avatar for funnyguy1

Write a program that opens a file, reads records into a container of data structures, and prints out the sum in order. You can use Vectors to contain the data structures. 1. Create a data structure to represent the record (struct cost in cost.h) 2. Write a function called parse_account …

Member Avatar for iamthwee
0
364
Member Avatar for rithish

can any one please elaborate why template is being used i dont understand in most of the google page they say that we can reuse the code but even in inheritance we do that .why templates?????

Member Avatar for mike_2000_17
-1
89
Member Avatar for Enrique Nivasch

Hi, I am getting the following error while compiling error: argument of type 'void(FClass::)()' does not match 'void(*)()' on the line fPointer=instance.PrintIt; // Give the pointer the function address This is my code /** * @file FPointer.c * This is the main FPointer program start point. */ /** * Main …

Member Avatar for DeanMSands3
0
338
Member Avatar for mahnaz0098

hello can any one give me a simple examle code to read and write to serial port? i want to send data to the port and recevie the same. i use visual c++

Member Avatar for Ancient Dragon
0
215
Member Avatar for triumphost

In OpenGL, I'm reading about glVertexPointer which has a parameter: `const void* pointer` and it is a pointer to the coordinates of the first vertex. Thing is, it doesn't have any parameters that tell you the amount of vertices there are. I'm wondering if there is a way to copy …

Member Avatar for triumphost
0
211
Member Avatar for Suzie999

Hi, I wonder if anyone can direct me to a win32 API or offer some logic as to how I might copy memory to a specific location in an array. What I am doing at the moment is copying an unsigned int into an unsigned char[]. The reason is to …

Member Avatar for Suzie999
0
144
Member Avatar for np complete

I use this function quite a lot. Recently one of my friend told me it is not good to use fflush(). I googled it, and found that it gives some kind of unexpected behaviour. My question is when does this function works improperly and why? Nowadays I use scanf("[^\n]") to …

Member Avatar for ravenous
1
155

The End.