49,761 Topics

Member Avatar for
Member Avatar for naveentj

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 …

Member Avatar for Salem
0
170
Member Avatar for Jsplinter

How do I invoke the int operator < instead of the int* operator < ? [CODE] vector<int*> pVec; std::sort(pVec.begin(),pVec.end(), /*????*/); [/CODE]

Member Avatar for Jsplinter
0
5K
Member Avatar for thecoolman5

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 << …

Member Avatar for raptr_dflo
0
2K
Member Avatar for ztdep

[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. …

Member Avatar for alwaysLearning0
0
128
Member Avatar for gingank

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...

Member Avatar for yoni0505
0
191
Member Avatar for KAY111

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; …

Member Avatar for L7Sqr
0
170
Member Avatar for tomtetlaw

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 …

Member Avatar for tomtetlaw
0
2K
Member Avatar for CodeGuy

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 …

Member Avatar for Ancient Dragon
0
195
Member Avatar for tomtetlaw

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for merse

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?

Member Avatar for merse
0
87
Member Avatar for mirkuh

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 …

Member Avatar for JasonHippy
0
407
Member Avatar for Kiah07

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 …

Member Avatar for pseudorandom21
0
510
Member Avatar for Komerad

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 …

Member Avatar for Komerad
0
1K
Member Avatar for AW8Dragon

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 …

Member Avatar for m4ster_r0shi
0
117
Member Avatar for sadsdw

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: …

Member Avatar for sadsdw
0
117
Member Avatar for akhal

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 …

Member Avatar for NathanOliver
0
418
Member Avatar for king03

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 …

Member Avatar for m4ster_r0shi
0
196
Member Avatar for m4ster_r0shi

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) …

Member Avatar for m4ster_r0shi
0
242
Member Avatar for zachmandude32

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 …

Member Avatar for zachmandude32
0
1K
Member Avatar for Thisisnotanid

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 …

Member Avatar for Moschops
0
234
Member Avatar for AW8Dragon

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 …

Member Avatar for AW8Dragon
0
405
Member Avatar for mybluehair

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, …

Member Avatar for gusano79
0
130
Member Avatar for Vidgie65

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 …

Member Avatar for mike_2000_17
0
381
Member Avatar for adityasingh

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 .. …

Member Avatar for Moschops
0
111
Member Avatar for xpartmgr

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 …

Member Avatar for xpartmgr
0
162
Member Avatar for emmaand

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 …

Member Avatar for murnesty
0
8K
Member Avatar for merse

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.

Member Avatar for lcordero
0
2K
Member Avatar for niggz

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 << …

Member Avatar for niggz
0
407
Member Avatar for bopiqz

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 …

Member Avatar for Celtrix
-2
119
Member Avatar for Celtrix

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 …

Member Avatar for Celtrix
0
171

The End.