49,756 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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, … | |
Why do you think there are soo many programming languages? ![]() | |
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 … | |
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 | |
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 … | |
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 … | |
#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 … | |
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, … | |
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 … | |
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) { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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()); // … | |
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 … | |
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 =") … | |
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 … | |
> "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: … | |
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 … | |
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). … |
The End.