49,756 Topics

Member Avatar for
Member Avatar for richasr1

Im having a bit of trouble converting the delphi code below into c++, i'm sure I need to use a Switch statement but I seem to be getting it wrong. Basically, I have 6 panels mounted on a larger Panel, each caption will contain a random number. A button then …

Member Avatar for IvanC
0
555
Member Avatar for dinhpham1991

Write a program that reads a set of measurements from a file called sensorDataRaw.txt. There are two columns of data in the file; the first is time in minutes and the second is height in feet. The program should read all of the data into two arrays, and then sort …

Member Avatar for sfuo
0
189
Member Avatar for triumphost

I'm having a huge problem trying to learn how to export classes from a DLL. I can do some functions just fine but the classes are mangled :S I've tried from .def file, I've used extern "C" but when I did, it threw errors and won't export the class at …

Member Avatar for mike_2000_17
0
2K
Member Avatar for grh1107

I'm Creating a class that I want to call a recursive function within it. However, the complier says i cant declare a function within a method, I was wondering how I could Recursively call that function, in the method, or how to recursively call that method, with out declaring the …

Member Avatar for mike_2000_17
0
3K
Member Avatar for poloblue

Good Afternoon, How would you solve a question that states: assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the pseudocode to find the record with a specific studentID if every single student ID from 101 …

Member Avatar for NathanOliver
0
194
Member Avatar for SoftEngGroupE

I need to load a BMP into C++ and code a program to convert it into a JPEG. I have very little programming experience and am wondering what libraries should be used to efficiently convert an image in this way. Is there a library that will convert the BMP straight …

Member Avatar for palanethra.ag
0
625
Member Avatar for triumphost

I have: 39H4-GTT7-LGLN And I'm trying to find every possible combination of sets. Basically each section is scrambled within itself. So there's only 16 combinations for each section. Example the first section I wrote it out as: 39H4 394H 349H 34H9 49H3 4H93 493H 4H39 9H34 934H 943H 9H43 H493 …

Member Avatar for Lucaci Andrew
0
103
Member Avatar for alex130

I'm trying to compile the following program (file named test.cpp): #include "stdafx.h" int main(int argc, char* argv[]){ INPUT *buffer = new INPUT[1]; //allocate a buffer buffer->type = INPUT_MOUSE; buffer->mi.dx = 100; buffer->mi.dy = 100; buffer->mi.mouseData = XBUTTON1; buffer->mi.dwFlags = MOUSEEVENTF_LEFTDOWN; buffer->mi.time = 0; buffer->mi.dwExtraInfo = 0; SendInput(1,buffer,sizeof(INPUT)); delete (buffer); //clean …

Member Avatar for JananiSekar
0
579
Member Avatar for poloblue

Good Afternoon, I'm reviewing structs, but don't get the concept very well. Assume the following structure declaration is given struct Rectangle { int length; int width; }; write a function that returns a Rectangle structure. The function should store the user's input in the members of the structure before returning. …

Member Avatar for poloblue
0
200
Member Avatar for jameswj83

I am having trouble with this assignment, especially the input file and how to get the data into an array: You will design a set of classes for storing student information, along with a main program that will read student information from a file, store the data, compute final grades, …

0
248
Member Avatar for kris222
Member Avatar for iamthwee
0
124
Member Avatar for Danja

Hello all, I have a long list of coordinates which are supposed to trace the outline of a city. They are supposed to go into a program which plots the trajectory from one coordinate to the next, thereby plotting the outline. For some reason (I'm not sure why; I'm trying …

Member Avatar for hkwhitten
0
989
Member Avatar for Techiz123

I want to Inject Scripts inside VBScript.dll site, so that the scripts are available to different COM interface which have implemented the Windows Script Interfaces(or Active Script Interfaces). Thanks

0
57
Member Avatar for monmondiesel

I am using the CUDD package for BDDs manipulation. I want to make a copy for a big data structure in it that is called the DdManager. The problem is : this data structure has so many pointers inside it , so when I make a direct copy it is …

Member Avatar for deceptikon
0
4K
Member Avatar for iamnot

I am generating the sequence 1,3,8,22,60,.... upto 10^9 the term mod of 10^9+7; However my code is giving inaccurate answers for large value of n. The formula I am using is ((1+Q)^(n+1)-(1-Q)^(n+1))/(4*Q) Here Q is sqrt (3) Here is my code.Can someone point out the error in the code or …

Member Avatar for Ancient Dragon
0
250
Member Avatar for learner_new

#include<iostream> #include<fstream> #include<string.h> using namespace std; int main() { //system("clear"); cout<<"\npls input the file where you want to read the data from\n"; string loc; getline(cin,loc); ifstream g; g.open (loc.c_str(),ios::in); string data; g>>data; cout<<"\n\n\n\n"; cout<<"\nthe data read from the file is\n"; cout<<endl<<data; return 0; } > even if fiole being read …

Member Avatar for learner_new
0
232
Member Avatar for poloblue

Good Afternoon, I'm having problems with my program that deals with fractions. The problems are with the functions multiply and divide that are not working correctly. So far I have this code. CPP FILE: #include <iostream> #include <cmath> #include "hw4_head.h" using namespace std; int main () { int a, b, …

Member Avatar for poloblue
0
146
Member Avatar for Remy the cook

I wanted to write the brute force algorithm for string matching by multithreading. I have made the program by using a single thread. In multithreading sample code, I have initialised the no. of threads to be strlen(text)-strlen(pattern). I do the matching in the ThreadFunc. Do I have to divide the …

Member Avatar for Lucaci Andrew
0
219
Member Avatar for Code_Geek

I have a problem with the following code.Please help me out #include<stdio.h> #include<iostream> #include<conio.h> #include<winsock.h> #include<winsock2.h> #include<fstream> #include<windows.h> #define WIN32_MEAN_AND_LEAN #include <sys/types.h> #include <streambuf> #include<string.h> using namespace std; int main() { int length; char *buffer; const int iReqWinsockVer = 2; WSADATA wsaData; if (WSAStartup(MAKEWORD(iReqWinsockVer,0),&wsaData)==0) { if (LOBYTE(wsaData.wVersion) >= iReqWinsockVer) { …

Member Avatar for triumphost
0
402
Member Avatar for taigi100

Hello, I am trying to make an OpenGL Hearts game ( like the one from windows 7 or such) but I expected some problems. First I will show you the code that iv done untill now : Card.h: #ifndef Card_H #define Card_H //#include <GL/glut.h> //#include <SOIL.h> #include <stdlib.h> class Card …

0
118
Member Avatar for triumphost

I have a Two Test classes that use variadic templates but I made the constructors explicit so that the compiler doesn't convert anything and leave everything as it was. One class was Array and the other was called 2DArray. When I intialize 2DArray, the compiler was converting its arguments to …

Member Avatar for deceptikon
0
3K
Member Avatar for TheWolverine

Hi all, I've browsed the net trying to find a paradigm to describe what I'm looking for but haven't been successful. So I'll try to explain it as succinctly as I can. Right now, for my PhD research, I've set out a few applications that take input files that have …

Member Avatar for TheWolverine
0
236
Member Avatar for triumphost

I'm trying to test my copy con and move con as well as their assignment operators. It NEVER gets invoked :S Copy con gets invoked just fine but the assignment operators are never called and neither is the move constructor. How can I test it to make sure it works …

Member Avatar for mike_2000_17
0
270
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
289
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
251
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
102
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
225

The End.