49,757 Topics
| |
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' … | |
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: … | |
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 … | |
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; … | |
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? | |
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 … | |
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 … | |
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: … | |
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++ | |
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 … | |
| #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 … |
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 … | |
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 … | |
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 … | |
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[]) { … | |
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 … | |
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? | |
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 … | |
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 … | |
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????? | |
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 … | |
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++ | |
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 … | |
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 … | |
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 … | |
hello i am working on a c,c++,java tutorial website, & i want to insert lots of source code example in it. I am doing this using <span> & CSS classes. I have seen some online code highlighter. i want to make one for my site. And is there any other … | |
Hey,hoping someone can help me. I'm having an error in my project. This is the problem for the project: In C++, the largest int value is 2, 147, 483, 647. So, an integer larger than this cannot be stored and processed as an integer. Similarly, if the sum or product … | |
Hello All! Well this is not exactly a C++ question. Please let me know if this needs to be posted elsewhere. So, here it goes: I have a project, cosisting of the entire buildrules in Makefiles. This has been built only on Linux. Now, i need to build it on … | |
I have been trying in vain to pass an array to a thread and have that thread loop through it. Here is code of a simple thread passing an int to it. #include "stdafx.h" #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <iostream> DWORD ThreadProc (LPVOID lpdwThreadParam ); int threadnumber = … | |
hi guys, im curious about c++ gui qt , the i searched for it and download QT opensource 4.8.2 (300mb+) for windows i run the installer, then it asked me for MinGw's directory in my pc, then i use the MinGw inside my codeblock, after that it said "Found version … |
The End.