49,761 Topics

Member Avatar for
Member Avatar for TheCollegeGuy

I have created MFC ActiveX project in VS 2010 using C++. I have added just one function "Add" to the project by clicking the Add method option in the menu that pops when you right click _DProjectname under ProjectnameLib in solution explorer. SHORT CSampleProgramActivex01Ctrl::Add(SHORT a, SHORT b) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); // …

Member Avatar for TheCollegeGuy
0
358
Member Avatar for salah_saleh

Hi! when I try to run this code: struct Cand{ // 0 -> not a cand // 0.5 -> preCand // 1 -> cand float status; // Row position int PosX; // Col position int PosY; /* * and many other things * */ }; int rows = 1024; int …

Member Avatar for salah_saleh
0
3K
Member Avatar for MasterHacker110

I am writing a program that is suppose to read all the lines in a .ini file and then the program will configure the network connectivity. ex. ip = 128.123.156.46 then it would set the ip address to 128.123.156.46 i have tried this: while(getline(infile, TheBuffer)) { if(TheBuffer == "ip =") …

Member Avatar for MasterHacker110
0
252
Member Avatar for dombit

ok so i want to build a simple app that woks across a network. basicly it is a c++ consle appliction, you type the ip and a message on the server consol and then that computer will do somthing based on the message. if anyone can derect me to a …

Member Avatar for ibrahimali88
0
103
Member Avatar for triumphost

> "warning: 'class Debug' has pointer data members but does not override 'Debug(const Debug&)' or 'operator=(const Debug&)' [-Weffc++]" The only pointer member I see here is the HANDLE hTHread. Why should I override my constructors or add a move/copy to this class as the compiler suggests? class Debug { private: …

Member Avatar for mike_2000_17
0
4K
Member Avatar for harryhaaren

Hey all, I'm attempting to bind a function, then store it in a map. Later I want to call that function with parameters that I don't yet have when I bind it. So this is the code `boost::bind(&State::setBufferSourcePlaying, &::top->dsp->getState(), 0, 1 )` Currently I'm not binding any "dynamic" data, ie …

Member Avatar for harryhaaren
0
257
Member Avatar for lxXTaCoXxl

I'm trying to convert a number to a string then back to a number to perform math, then back to a string to return it to the user. I don't understand the problem because this is how my friend did it (that I can remember and it worked for him). …

Member Avatar for NathanOliver
0
234
Member Avatar for кодирование

First of all, just registered and this forum looks great! PROBLEM: My program which I wrote in Code::Blocks, has compiled fine and has worked fine, but when I run the outputted file called (BINDED.exe) it shows a very quick console window then closes, I think this is due to the …

Member Avatar for georgeduroa
0
171
Member Avatar for poloblue

Good Afternoon, How do you write a two nested do-while loops to display the pattern: * ** *** **** ***** ****** So far I have this code, but it just displays ****** int i=0; do{ cout<<'*'; i++; }while(i<5); cout<<endl;

Member Avatar for poloblue
0
1K
Member Avatar for oggiemc

Hello all, Im getting the following error when i try to create a simple helloWorld C++ project in eclipse. Please note that i have MinGW, msys and my environment variables set up right. Im using Windows 7 and the 32bit Eclipse Juno. Error: Error 127 occurred while running autoreconf HelloWorld …

Member Avatar for Lucaci Andrew
0
575
Member Avatar for SCass2010

Hi everyone, I was wondering if anyone could help - I'm trying to split up a char* that contains a string, something like "*Stephen*10:11:00*02/07/2012*Hi there" I'm trying to split it up so it gets the position of the first * then the second, and stores whats between them in name …

Member Avatar for L7Sqr
0
2K
Member Avatar for alan91

How to write a program that will find the smallest, the largest, and sum of squares values in a collection of N numbers? (using loops)

Member Avatar for Lucaci Andrew
0
299
Member Avatar for XodoX

How di I use I/O redirection to load the input into an array ? % a.out < inputfile That's what I found. I don't know if that's all you need or if there's more..

Member Avatar for Lucaci Andrew
0
265
Member Avatar for ItecKid

Hello, I am attempting to write the merge sort algorithm which will generate a vector of 20 random integers and then sort them. The problem is, it does not output the sorted list, it merely outputs a series of zero's and one's. My code is as follows, any help is …

Member Avatar for Calbert21
0
483
Member Avatar for BirdaoGwra

Hi, I have some images which I update like below: count++; if(count >= sizeOfArray) { count = 0; } for(u32 i=0; i<sizeOfArray; i++) { s_image[i].image->setVisible(false); s_image[i].reverse->setVisible(false); } I want to know, how do I reverse it. I mean, it is increasing the count and I want to decrease it. The …

Member Avatar for BirdaoGwra
0
134
Member Avatar for lxXTaCoXxl

I'm out of practice on my C++ and have kind of picked up a new hobby; it turns out that I like creating electronic devices. Particularly amplifiers and sound to light kits. Stuff like that; the problem is that determining the amount of resistance a resistor on an old creation …

Member Avatar for NathanOliver
0
207
Member Avatar for grh1107

currently I'm rewriting old euler solutions into classes so i can store them in a library. I wrote a program that digitizes a number so it can check to see if it a pallindrome, The base class digitize dynamically allocates memory for the size of a number and stores each …

Member Avatar for mike_2000_17
0
252
Member Avatar for triumphost

How can I create a Modifiable Const vector but make it unable to be resized? Either that OR I want to return a pointer from a function but not allow the user to delete it. This is my example so far: class MemberRawArrayVector { private: vector<unsigned char> MemberRawArray; public: MemberRawArrayVector(int …

Member Avatar for mike_2000_17
0
213
Member Avatar for anuragcoder

Hi! I've encountered another problem, The code below is just the part of the code where the error occurs int FindStr(FILE *f, char *str) { int s_pos; //string position in the text int c_pos; //char position in the text char *string; char ccnt; //char count s_pos = -1; c_pos = …

Member Avatar for thunderox
0
11K
Member Avatar for phorce

Hello, I'm trying to convert some code from BASIC to C++.. But, I'm stuck on a particular part.. REM CREATE A MATRIX C WITH (COS(DN) , -SIN(DN)) : DIM C(NE, NS, 2) FOR N = 0 TO NE / 2 FOR E = 0 TO NE - 1 DC = …

Member Avatar for phorce
0
163
Member Avatar for triumphost

Why does the following code skip the initialization of values of the temporary created? Box::Box() : X1(0), Y1(0), X2(0), Y2(0), W((X2 < 0 ? -X2 : X2) - (X1 < 0 ? -X1 : X1)), H((Y2 < 0 ? -Y2 : Y2) - (Y1 < 0 ? -Y1 : Y1)) …

Member Avatar for Milton Neal
0
228
Member Avatar for poloblue

Good Afternoon, I'm having some problems with a problem that deals with raising the power of an integer. So far I have this code. #include <iostream> #include <cmath> using namespace std; int main() { int num, bigNum, power, count; cout << "Enter an integer: "; cin>>num; cout << "What power …

Member Avatar for mike_2000_17
0
278
Member Avatar for poloblue

Hi, I trying to let the user input how many numbers that they want to average and outputting the average of those numbers. I have this code, but not working as aspected. #include <iostream> using namespace std; int main () { int numCount, total; double average; cout << "How many …

Member Avatar for triumphost
0
215
Member Avatar for triumphost

I'm a bit confused atm, I don't know when to use const T& or T& or T as a parameter. Currently I'm doing: void Resize(std::vector<T> &Vec, const size_t &NewLength) //Ahh edited the function as a result of Lucaci's answer. { Vec.resize(NewLength); } //But thinking of doing: void Resize(std::vector<T> &Vec, size_t …

Member Avatar for mike_2000_17
0
2K
Member Avatar for trishtren

Hey, Iv been looking around google for the past few days to find ways to embed python 3.2 into my c++ application. I however want interpeter to be compiled into my application, so i can merely distribute one exe file without relying on the user to install python. However the …

Member Avatar for TrustyTony
0
281
Member Avatar for silvercats

What does main() function do in?wtz da difference between void main() and int main()?why should I use? extra two questions :- what first two lines, #include <iostream> using namspace std; do? thanks

Member Avatar for silvercats
0
868
Member Avatar for poloblue

Good Afternoon, I'm having trouble process 2-D arrays to store and process data. I have problems with implementing the void grading function and void showgrades function So far I have this code: Cpp file: #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <iomanip> #include "lab_20_head.h" …

Member Avatar for poloblue
0
1K
Member Avatar for XodoX

I was told you can access the index of an array and save it in a variable. Like, as you know, every element is referenced by an index number. 0,1,2,3,4 etc.. I don't want to save the content, I need the index number. I will need to know the position …

Member Avatar for triumphost
0
171
Member Avatar for Archuom

I have a file info.txt like below NAME ID=karan PLACE=Mumbai AGE=23- PHONE=1234 HANDICAP=No- OCCUPATION=Student NAME ID=Ravi PLACE=Goa AGE=25- PHONE=4567 HANDICAP=Yes- OCCUPATION=Employee I want to read the file with make them into record strings as below "NAME ID=karan PLACE=Mumbai AGE=23 PHONE=1234 HANDICAP=No OCCUPATION=Student" "NAME ID=Ravi PLACE=Goa AGE=25 PHONE=4567 HANDICAP=Yes OCCUPATION=Employee" Please …

Member Avatar for Lucaci Andrew
0
914
Member Avatar for Dudearoo

**Dudearoo** *Useing Code::Blocks* ok, ive got a somewhat simple error that i cant crack, First heres my code. #include <iostream> #include <cstdlib> #include <stdio.h> #include <time.h> #include <conio.h> #include <stdlib.h> #include <iomanip> #include <windows.h> // so to use strcmp #include <cstring> #include <fstream> using namespace std; int main() { ofstream …

Member Avatar for Lucaci Andrew
0
635

The End.