49,761 Topics
| |
Hello, I have a very weird problem. I have been using ReadFile() for reading data from a device connected to the PC over USB. As the data to be read is received in chunks of 64 bytes, always, ReadFile() is called with 64 bytes to read. However, when i have … | |
How do I invoke the int operator < instead of the int* operator < ? [CODE] vector<int*> pVec; std::sort(pVec.begin(),pVec.end(), /*????*/); [/CODE] | |
hi, i have this code: [CODE]#include <iostream> #include <fstream> #include<cstdio> #include<cstdlib> using namespace std; int main (char argc) { for(;;) { fstream myfile; myfile.open("example.txt"); cout << "1: Write" << endl; cout << "2: Read" << endl; int n1; cin >> n1; if(n1 == 1) { string n2; getline(cin,n2); myfile << … | |
[CODE] class cellPair { public: vector<int> pair; int size; cellPair(const int& a) { pair.push_back(a); size=static_cast<int>( pair.size() ); } }; int main() { map<int, cellPair> aMap; aMap[1]=cellPair(3); aMap[1]=cellPair(2); } I think the aMap.second.size should ==2, but it still have 1 value, the second value did not push back to the pair. … | |
Could anyone tell me the different between this two? I try to learn the C++ and i'm a newbie on it? Any recommended books or website to learn C++? Thanks in advance... | |
Hey, I just discovered a very interesting phenomenon. I have 2 programs. m.cpp [CODE] #include <iostream> #include<time.h> using namespace std; int main() { int a=34,b=40; while(1) { usleep(400000); cout<<a<<" "<<b<<"\n"; } } [/CODE] and n.cpp [CODE] #include<iostream> #include<stdlib.h> using namespace std; int main() { int a,b; while(1) { cin>>a>>b; cout<<a<<b; … | |
I've registered my raw input devices successfully but Windows doesn't send me the WM_INPUT message when I press keys or do things with the mouse. I am using an event hook to get the messages since I'm using SDL and it receives other messages fine. This is the code I … | |
Hi, I'm new here. I'm using log4cpp as a data logger for my program. Does anyone konw how to add a collumn header for logs files created using log4cpp?? I'm using the Rolling file appender which rolls over log files after a defined file size is reached. I would like … | |
I am trying to use SDL with the Raw Input API but whenever SDL sends me a keyboard input message, the [icode]msg[/icode] it sends me is an invalid pointer and it gives me an access violation when I try to use it. I check to see if it's invalid for … | |
Are there ay freely available language library? I need class of LETTER, WORD, SENTANCE, TEXT, ... for example a letter can be more than one character, like sch in German WORD category has to be stored, like noun/adjective etc. I have to write my own package? | |
Hi, I want to call CTest's StaticMethod via a function pointer from Class CCaller. I noticed that StaticMethod is not inlined and the call takes much more time compared to calling the function directly. When calling directly the function gets inlined - even without the inline keyword. Can't the function … | |
I need some help with some code. I'm using boost filesystem library V3 c++. I am using an iterator to list files and directories recursively. My program runs perfectly until it scans the "System Volume Information" directory on Windows machines. At that point the program throws an exception because it … | |
Hi I found this piece in another "solved" threat. The person that wrote this however had a different problem with it. I changed the bar size value from 12 to 6500. For me this works but has a major flaw : When : lengths to cut < size of a … | |
Hello, got a question that has been bugging me For example there is this text file: Name: yyyy mm dd Phone: Email: Andrew 1989 5 8 123459886 somethin@ Emma 1988 1 30 256497565 other@ Stan 1991 12 26 456548912 tell@ Charles 1975 8 11 123154894 2eee@ can i get first … | |
Hi everyone, I'm trying develop a code to read a file containing records of INDIVIDUAL ID, FATHER ID and MOTHER ID, and re-code the file using multiple trees. At this point I'm not concerning to re-code the IDs and I would like to build the multiple tree. The idea is: … | |
Hi I have to pass a 2D array by reference to a constructor of a call where it manipulates this array. I have found out one way of doing so as: [code] class calc{ double (*my_a)[size]; calc(double (*arr)[size] /* or double [][size] */) : arr(my_a) {} // Passing array in … | |
Hi there guys I am having trouble with a particular input in my program. If you will run my program and enter the word "IT" in Enter Course, it loops and jumps to do you wish to return to the main menu. Please use Microsoft Visual C++ 6.0 Professional Edition … | |
I have two code snippets that involve recursive manipulation of std::strings. [B]code snippet 1[/B] [CODE]#include <iostream> #include <string> void print_stuff(int min_n, int max_n) { struct local { static void build_stuff( int min_n, int max_n, int cur_n, int cur_c, int max_c, bool inc, std::string & ret) { if (cur_c == max_c) … | |
Compiler: gcc and/or g++ Linux: Mac OS X 10.6.7 curlpp version: 0.7.3 -Hi I am having trouble compiling my cpp program, I am just trying to do an example from the curlpp website [URL="http://tinyurl.com/3auvcjo"]http://tinyurl.com/3auvcjo[/URL] . I am using that code exactly. Also I've tried to search online to see what … | |
Hi everyone. I've decided to learn C++ and have come to the inescapable step of having to choose my development environment. I have a short list of IDE's I'm considering but, since I'm new to C++ and programming in general, I'm confused as to which I should pick. I've taken … | |
Hello everyone, this is my very first post in this webpage so here we go. I've got this problem with my hw assignment, it's almost finished except for one part. The hw is as follows: - Create an address book, creating 4 text files in the computer memory. Each text … | |
I'm testing out a new program I'm about to make, and created a nice 1280 X 960 BMP image in Photoshop of a field with grass. When I try to load this image into my c++ program running Allegro, the image looks AWFUL. Some of the grass has turned blue, … | |
These are the last few errors in my code that I am having issues with. Please provide some direction or thought as to what to do to fix it. generator.cpp(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int generator.cpp(11) : error C4430: missing … | |
Need help in making a program on library management... project {300-400) lines can anybody tell me member functions for this program.:( it's a school project.. needed only a small program on the topic...and without header file graphics.h i am very new to c++ language.. so pls help me guys .. … | |
I am new to C++ and have a question about include files. I have some classes that I want to share between the main and other classes also. So I include the reference in my main and also in my class. However, this causes a compiler error. If I comment … | |
Hello, I am a total beginner at c++ I am writing a console program and I am wondering how I should do to exit the program, like if the user is asked Do you want to continue ( yes/no) and the user enters no then I want the console to … | |
How to initializing a const set with list of values? I want to initialize in the preambulum, so I dont want to define and initialize an array before initializing the set. I want to do this in one row, if it is possible. | |
Hello everyone. I am working on my final project at university for C++, and I got stuck a little. I have an array inside an array. And I want to access that inner array's member and print it with cout. Here is the code: [code=c] void standings(userClub uc){ cout << … | |
I am currently doing a project to build a control system for vertical take off and landing operation of UAV (unmanned aerial vehicle. I have one C++ coding but there are too much error in it and I've no idea how to solve it. Can anyone help me to fix … | |
command line/terminal arguments are driving me bananas according to most of my google searchs this should work by the way i am using g++/gcc version 4.6.0 [CODE] #include <iostream> #include <string> using namespace std; int main(int argc, char **argv){ if(argc==0){ cout<<"Use -l or -ls!\n"; } if(string(argv[1])== "-l"){ //code for lua … |
The End.