49,761 Topics

Member Avatar for
Member Avatar for theories

In all of the projects I've created in my college classes I've always declared the variables that will be used in multiple methods (passed by reference) in my main method and then passed as needed, allowing for the main method to be nothing more than a control for what variable …

Member Avatar for ArkM
0
84
Member Avatar for Lukezzz

If I have a backgroundWorker that has executed like this: [code] backgroundWorker2->RunWorkerAsync(); [/code] If I now want to cancel this, I have put this line of code at the very last line in the _DoWork event of the backgroundWorker2. I am not sure if that works or if it is …

Member Avatar for Lukezzz
0
134
Member Avatar for ItecKid

Hello, If I have code like such: [code=c++] map <string, map <string, int> > foo; map <string, map <string, int> >::iterator bar; [/code] How to access the value of the nested map? Normally I access a map's value like such: [code=c++] bar->second; [/code] To that end, I tried doing this …

Member Avatar for ItecKid
0
2K
Member Avatar for drjay1627

if we use queue from c++ stl, we don't need //void enqueue(struct queue *q, int a) //int dequeue(struct queue *q) functions? my TA has it on the slides but since the c++ queue has push and pop enqueue and dequeue isnt needed, right?

Member Avatar for drjay1627
0
65
Member Avatar for Nemoticchigga

Does anyone know how to delare a managed class in unmanaged code? This is driving me nuts, because I can call unmanaged from managed, but not the other way. Is there a way to do this? Thanks in advance. I want this for example: class foo { public: //other code …

Member Avatar for Ancient Dragon
0
91
Member Avatar for kunal123

hii all, im trying to connect remote sq server using in c++ using CDatabase class. im getting an sql error Connection Failed SQL State '01000' SQL Server Error 14: [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance()). SQL State '08001' Connection Failed SQL Server Error 14: [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection the …

Member Avatar for MrSpigot
0
159
Member Avatar for rahul8590

i am working on image processing , which intially i used to do using MATLAB . but now i have been told to do using using JAVA or C++ programming ,. Since i know the fundamentals of C++ i guess i would be the right choice But the problem is …

Member Avatar for Nick Evan
0
240
Member Avatar for woe joy

I wish to parse an xml file but after a lot of reading, am confused by the various compilers available for for it. What would be the best way to parse an XML file and what sort of compiler/parser would you use for it?

Member Avatar for Ancient Dragon
0
30
Member Avatar for RoselineM

can anyone help me with this output: ^^^^^#^^^^^ ^^^^###^^^^ ^^^#####^^^ ^^#######^^ ^#########^ ########### i have done the following so far & am struggling to continue: #include <iostream> using namespace std; //Function draw shape void displayRow(int sizeP) { for(int i = 1; sizeP - i + 1; i++) cout << '^'; …

Member Avatar for DangerDuke
0
125
Member Avatar for tomtetlaw

idk why i get this error i just do here is the code i have: [code=c++] #include "includes.h" int main() { } [/code] here is the error: c:\documents and settings\tom\my documents\visual studio 2008\projects\c++ tutorial\c++ tutorial\main.cpp(3) : error C2143: syntax error : missing ';' before 'int' any ideas?

Member Avatar for tomtetlaw
0
152
Member Avatar for jschri4

string rating(bool ozone, bool no2, bool so2) { string result; int count = 0; if(ozone == true) { count++; } if(no2 == true) count++; if(so2 == true) count++; if(count == 3) result = "Gold Star"; if(count == 2) result = "Silver Star"; if(count == 1) result = "Ok"; if(count == …

Member Avatar for Zhujy
0
78
Member Avatar for Barefootsanders

HI, I'm trying to write an application in C++ that has two things - a TCP server (listen server) as well as a TCP client where it can send to other TCP servers. I currently have both parts set up simultaneously. I did this by calling fork() and having the …

Member Avatar for Duoas
0
127
Member Avatar for jschri4

Im suppose to read in a file (which it isn't doing) and get numbers form them to see if they pass or fail certain specifications. Can someone help? the exact specifications are: The company you work for, Acme Environmental Monitoring, runs sensors to test air quality at different locations. These …

Member Avatar for SeeTheLite
0
172
Member Avatar for jspeakers

Hi, I am not that great with C++ but I am trying to write code that will be able to import 2 wave files I have - the first file is my sine wave sweep file the second is my impulse response of the room. Once imported I wish to …

Member Avatar for nucleon
0
392
Member Avatar for Danny_501

Hi all, i asked this question a few days ago bit its still unsolved. I'm reading a text file of strings, line by line, and storing them into an array. when i try and print them using this function: [CODE=cpp]template < typename T > void printArray(T * const array, int …

Member Avatar for Danny_501
0
97
Member Avatar for rEhSi_123

Hello everybody! I am creating a Book library system in C++. I created a login class where the user types in a username and password and if successful is able to log into the menu system. Now, everything goes well unless and untill the user types in the right credentials …

Member Avatar for SeeTheLite
0
5K
Member Avatar for shea279

Does anyone know how to use let the user define a custom hotkey with the control IDC_HOTKEY, then register it on a system wide scale, so it sends a message back to the application when its pressed? And I have googled, without much luck.

Member Avatar for shea279
0
98
Member Avatar for Zcool31
Member Avatar for iTsweetie

Hi all, I've been instructed to write a program that inputs a dollar amount to be printed on a check, and then prints the amount in a check-protected format with leading asterisks of necessary. Nine spaces are available fore printing an amount (max of $99,999.99). The program looks like this: …

Member Avatar for iTsweetie
0
135
Member Avatar for blahblah619

Help please! How do I change this so I input the letters instead of numbers? I'm confused. I want to make it so I can enter "R" instead of "0" etc. Also, I don't know where to put an if-break for the user to enter "Q" or "q"... [code] #include …

Member Avatar for SeeTheLite
0
3K
Member Avatar for Falkoner1

Okay, I'm trying to have a linked list autonomously delete itself, however, the destructor function I am using doesn't seem to work, it just keeps constantly looping, until the program just ends itself. Here's the function: [CODE]node::~node() { if(this->next != NULL){delete this->next;} delete this; }[/CODE] Basically, this should run through …

Member Avatar for Falkoner1
0
162
Member Avatar for mimis

Can i make a function with a vector<int> parameter instead of an int array?

Member Avatar for NicAx64
0
89
Member Avatar for Nemoticchigga

I have a struct. I want to declare a pointer to that struct. Now I want 10 of those structs. How is this declared? I have tried (call the struct foo for example): foo* test[10]; when I make a call to test[0]->whatever or test[5]->whatever it seems to always write to …

Member Avatar for MrSpigot
0
112
Member Avatar for daviddoria

This simple example fills a vector with numbers 0-9. Then I use find() to find where the 7 is. Then I saw online you can get the index by simply subtracting V.begin() from the iterator that find() returns. Has - been overloaded for iterators to do some magic and return …

Member Avatar for StuXYZ
0
92
Member Avatar for Barefootsanders

Hi, I'm trying to code a program that involves a double linked list. I have the linked list working but the information in the link list need to be shared between 2 different classes. Is it possible to pass a linked list as reference and manipulate it within the different …

Member Avatar for SeeTheLite
0
112
Member Avatar for snap!

ok so i am going to be taking a c++ course next semester and was wanted to get better knowledge so i have a proble that i was givin that am having some trouble, just some pointers on where/how to start will be helpful... Im not sure how to set …

Member Avatar for rahul8590
0
92
Member Avatar for serkan sendur

hi guys, i downloaded eMbedded Visual C++ 4.0 and when i run setup.exe it asks for a serial number, where can i find it? thanks

Member Avatar for jbennet
0
2K
Member Avatar for Talguy

For a project I am working on we're using libserial to communicate with out hardware. the problem with libserial is that when you call read() it returns an unsigned char and readline() returns a string. We're encoding our collected data from four sensors into 32 bit unsigned integer if I …

Member Avatar for Talguy
0
102
Member Avatar for songweaver

Hey guys I am having a problem knowing where to start on writing this Leap Year program that wants a day number output. Here is the scenario: Write a function [I]dayNumber[/I] that returns the day number (1 to 366) in a year for a date that is provided as input …

Member Avatar for songweaver
0
673
Member Avatar for daviddoria

I was using a library recently and I was getting a "undefined reference" linker error when I tried to call a template function with a type that they did not plan on me using. I asked on the mailing list and they said to call [code] VSL_VECTOR_IO_INSTANTIATE(vnl_matrix_fixed<double,3,3>); [/code] I guess …

0
48

The End.