49,757 Topics

Member Avatar for
Member Avatar for dospy

i am planning to start learning how to use threads. my question is: should i first learn windows.h's functions for threading before boost to get the pattern or should i jump right to the boost threads? ps: sry if i posted in the wrong section

Member Avatar for dospy
0
247
Member Avatar for meli123

hey alll..I posted earlier on needing help for a code on input #..base..print decimal form..I actually didnt learn this in high school so thats why I was having so much trouble :@ Now that I read up and understand the logic in bases..I was thinking that for my code I …

Member Avatar for VernonDozier
0
150
Member Avatar for Allander

Hi! I don't understand why I can't use my functions declared like this: [CODE]#include "groundArray.h" int groundArray::getlistX(int i) { return x; } int groundArray::getlistY(int i) { int groundlistY[] = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; return groundlistY[i]; } int groundArray::getlistWidth(int i) { int groundlistWidht[] = …

Member Avatar for MonsieurPointer
0
212
Member Avatar for murnesty

It's my first time to use functor. So hope can get some guide here. My program need to call different function depend on input. so i thinking to use functor to do that. e.g. main.cpp [CODE]#include "functor.h" #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { …

Member Avatar for Eagletalon
0
163
Member Avatar for mdheerajgupta

Hi All, I want to trap inRange and outRange event of the bluetooth device i.e. paired with my windows7 machine. Thanks in advance.

Member Avatar for Eagletalon
0
191
Member Avatar for eviandc

Hi, I'm a beginning C++ student and have an assignment to dynamically create an array of a struct to store students' first names, last names, and test grade scores, and then pass it via pointer to a function that will sort the grades and names in ascending order. I wrote …

Member Avatar for eviandc
0
1K
Member Avatar for mahesh vidhate
Member Avatar for markfw

Hi I have a code as follow: [CODE] template<class T> inline bool IsValidUnsignedLong(T n) { return (T)(unsigned long) n == n; } [/CODE] When I pass -l to that function, it returns TRUE which it shouldn't since its not unsigned. Can anyone explain to me the reason behind this? why …

Member Avatar for mike_2000_17
0
198
Member Avatar for ChaseRLewis

I've been looking and I'm a bit lost about how to change the target of ostream so that I could write to other buffers than the console.

Member Avatar for mike_2000_17
0
107
Member Avatar for ben1996123

I've managed to use classes in separate files before, but I can't seem to get it to work here. I was just programming some very basic classes for a simple game I wanted to make. Here is the main.cpp file: [code]#include <iostream> #include "energySystem.h" #include "healthSystem.h" #include "intelligenceSystem.h" using namespace …

Member Avatar for ben1996123
0
555
Member Avatar for iamthesgt

In writing a logfile program, I need a function to output the log entries between two dates. I use [ICODE]seekg()[/ICODE] and [ICODE]tellg()[/ICODE] to save the position of the first entry to output and last entry and then go back later to output the data in between. However, [ICODE]seekg()[/ICODE] when told …

Member Avatar for iamthesgt
0
271
Member Avatar for Zssffssz

Ok how do I make a C++ console app format a floppy disk for a Win or Linux Computer? I really want it to be auto-matic like without the whole volume tilte, filesystem; that sutff. PS How would I setup virtual memory in linux? Thanks answer the floppy question first. …

Member Avatar for Moschops
0
168
Member Avatar for valestrom

My program is in an infinite loop, when It hits the "Bye" part in the code it goes right back up to the top. Help with this. It's a pretty simple program so I can't see what I did wrong. [CODE]#include <iostream> #include <windows.h> using namespace std; int main () …

Member Avatar for Zssffssz
0
162
Member Avatar for mike_2000_17

Hey, I have a set of types which are all arithmetic (have operators for addition, subtraction, multiplication, etc.). I want to aggregate any number of them into a single object, so I'm using the std::tuple class template and the <tuple> library (and Boost.Tuple for backward compatibility). My question is a …

Member Avatar for mike_2000_17
0
517
Member Avatar for stereomatching

[CODE] boost::shared_ptr<resource> resource_ptr; boost::mutex resource_mutex; void test() { if(!resource_ptr) //#1 { boost::lock_guard<boost::mutex> lk(resource_mutex); if(!resource_ptr) //#2 { resource_ptr.reset(new resource); //#3 } } resource_ptr->do_something(); } int main() { boost::thread t1(test); boost::thread t2(test); t1.join(); t2.join(): return 0; } [/CODE] According to the text book, this kind of codes may cause race condition, but …

Member Avatar for stereomatching
0
179
Member Avatar for Adam Ma

Ok so i have trouble with looping with while and for statments heres the questions: 1. Write a program that gets a positive integer from the user and prints all the numbers from one to that integer. If the inputted number is zero or negative, then the program will print …

Member Avatar for cherrymae.calma
0
166
Member Avatar for Zssffssz

Ok heres what I want to do: I want to put a file in a console application (during compileation\codeing not running) and when it runs it saves the file in the same place it was run from. Like moving a movie as an exe to hide it while it is …

Member Avatar for pseudorandom21
0
110
Member Avatar for cent91

i have a code written in c++/Cli (CLR Console app) that uses .Net framework. it basically uploads a file to a ftp server. i wanna run it on computers that dont have .net framework. and are running windows xp or windows 7. can i somehow convert it into win32 console …

Member Avatar for thines01
0
283
Member Avatar for Carrots

Hi, I am trying to a play a .wav file in a C++ program. I think my code is OK, but when it plays, it plays the default windows 'error' sound, not my .wav file. This is the program: [code] #include <iostream> #include <windows.h> #include <mmsystem.h> #pragma comment(lib,"Winmm.lib") using namespace …

Member Avatar for pseudorandom21
0
6K
Member Avatar for vrs1155

friends i m using vc++ 6.0 and oracle 10g version.i created mfc file and connected database. i done insert and delete operation.but i cant check or view the data(table).can you any one tell how to do? and any other option 2 view the database thanking you

Member Avatar for thines01
0
134
Member Avatar for grimreaperx2

Well im having this problem on how to add large integers. I have used strings to take in a very large number something that can work on as many digits as you need it to. I take in 2 strings for the numbers you want to add. After which I …

Member Avatar for grimreaperx2
0
1K
Member Avatar for Tinee

Hi, I am almost done with C++ and my project is on Resistors. The problem is that when i try to tun the program, line 37 and 34 has an error saying "no match operator". It is the same as line 28 and 31. Then when I make line 34 …

Member Avatar for diamondw
0
154
Member Avatar for Tom_Weston

What I would like is when I input the file path in the console window (lets say C:\hello.txt), I would like it to create, open, then write text into the file. Here's an example of my code. [CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main () { …

Member Avatar for Tom_Weston
0
104
Member Avatar for sgiusti88

I am trying to learn c++ from a textbook (as so many others) but am having a really hard time following this example: Write a program to input and display a sales file. Each input line contains an integer ID number and a sales amount. When the end of the …

Member Avatar for NathanOliver
0
304
Member Avatar for NoUserNameHere

What does it mean if there is an ampersand right before the function name? Something like: int& myFunction(int& a, int& b) Also my book said something about how it doesn't create a copy of something if you pass it by reference, but what exactly does that mean? I never understood …

Member Avatar for mike_2000_17
0
107
Member Avatar for tajendra

Working with dll i got into a situation where loading a dll can cause security threat. lets say for example when you load a DLL, it gets same access privilege as the calling process. So if calling process is running with Admin privilege the loaded dll gets the elevated privilege …

Member Avatar for vijayan121
0
150
Member Avatar for Labdabeta

I am still having major trouble with my openGL model program. The big issue is that I cannot figure out how to debug it since I am saving the important data to the graphics chip using vertex buffer objects (VBOs) so at least as far as I can tell, I …

Member Avatar for raptr_dflo
0
469
Member Avatar for dospy

there are 2 common ways to loop through a vector 1: [CODE] vector<int> myvec; // let's assume it's initialized for(int i = 0; i != myvec.size( ); i++) { // code // access by 'myvec[i]' } [/CODE] 2: [CODE] vector<int> myvec; // let's assume it's initialized for(vector<int> :: iterator i …

Member Avatar for dospy
0
180
Member Avatar for senator22

Can someone help me on how to handle an exception (warning) box in my C++ application? When I run my application in launches an exception box (warning in particular) with two buttons "Break" and "Continue". When I click the continue button the application then runs successfully without errors. What I …

Member Avatar for Fbody
0
108
Member Avatar for neomatrix248

Hello all, This is my first post here. I've exhausted every resource I can think of in hopes of figuring out what I'm doing wrong, but I can't seem to get it right. I'm doing a homework assignment where I have to solve the 8puzzle problem using BFS, DFS, Iterative …

Member Avatar for neomatrix248
0
948

The End.