49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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? | |
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 << '^'; … | |
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? | |
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 == … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
What is the platform independent method to get functionality provided by windows.h? | |
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: … | |
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 … | |
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 … | |
Can i make a function with a vector<int> parameter instead of an int array? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … |
The End.