49,761 Topics
| |
What would be a common strategy for using DLLs coded in native C++ in C#? I'm not really finding much good information about it, other than writing the DLL in C. | |
I'm brand new to C++ ,I've written following code for finding a number's factorial,Can you please let me know how to write it more elegantly ? [CODE]#include <iostream> using namespace std ; main () { int num = 0 ; // declaring variables double result = 1 ; long int … | |
I'm getting a LN2019/LN1120 error, and I have no clue why... any suggestions? [CODE]#include <iostream> #include <string> using namespace std; class Time { public: Time(int hour, int minute); Time(); void setHour(int); void setMinute(int); int getHour(); int getMinute(); void incrHour(int); void incrMinute(int); void printTime(); protected: int hr, min; }; Time::Time( int … | |
Hi, i am trying to write a program which calculates the sum of the prime numbers below a specific limit using an algorithm called the Sieve of Eratosthenes(Wikipedia it). I am getting an error though when i run my program. It says debug assertion fail and something how the iterator … | |
Hello I have this code below where I use the method ->ReadToEnd() to read in the whole file into the String test. The thing is that I have to use the method ->ReadToEnd() in this case because I use another class that only have this functionality. I cant read line … | |
I have a pointer object consisting of different arrays of variable length. I want to get one of the arrays from the pointer array and store is in a different array. How would I go about doing it? When I try the method, it gives an error: [B]initialization with '{...}' … | |
I have a variable [B]x[/B] declared as [B]int *x = y[/B], where [B]y[/B] is also a pointer variable. Is there any way to store the variable in [B]y[/B] to [B]x[/B] without making [B]x[/B] a pointer such that it would look like: [CODE] int x = y; //y declaration => int … | |
As my projects grow larger I'm beginning to appreciate more robust code with higher re-usability. Also easy to use error handling can make coding for errors much less repetitive. Is there a good online set of articles anyone could recommend? | |
Hi there I have been building a program separately and testing the code in sections. Which is fine as it works individually. However two of the classes are designed to share variables. The idea is the first class generates a partcile and then scans through a list of gridCells. It … | |
Hello, I've been looking arround the internet, and I found the command [ICODE]wait(15);[/ICODE] to wait for 15 secons. I used the header [ICODE]#include <time.h>[/ICODE] and I got an error. Can someone please help me and tell me what I've been doing wrong? | |
im looking for a more efficient algorithm, is there any known one? ive checked my math books and c++ book and really didnt find anything more efficient than the following : [CODE] int first_prime(int num) { for (int i=2;i<sqrt(num);i++) { if (num%i==0) { if (isprime(i)); return(i); } } } bool … | |
Can someone please help me with this program. These are my instructions that were given to me... When I finish the inputs and it comes back with the numbers the payment amount is wrong [CODE] /////////////////////////////////////////////////////////////////////////////// // // Name: GCD.cpp // Author: Jeffrey A. Stone // Course: CMPSC 101/121 // … | |
Hello.Does anyone know if you can disable the popup menu from an edit control ?Also can someone suggest a good method of trapping a mouse right click on an edit control within a window's main procedure ?I used WM_PARENTNOTIFY but that message is received from every editbox in my window … | |
Hello, In my program, I needed to do some functions that are found in windows.h, but I got an error saying that it could not find any of the following: [ICODE]#include <Windows.h>[/ICODE] [ICODE]#include <windows.h>[/ICODE] [ICODE]#include <Windows>[/ICODE] [ICODE]#include <windows>[/ICODE] Could someone please upload a coppy of windows.h for me, and [COLOR="Red"]PLEASE … | |
I need some help with an assignment, it is supposed to have 9 functions, one being main, and the other 8 void. The ONLY global variables that are allowed is the istream and ofstream. All programs in main are to execute in the order listed. I compile the program it … | |
I am doing data analysis and for that I have to edit MS Access file in csv format to labelled format... ie. |Student, Name, Whatever | |12,XyZ,PPP | ------to--------- 1.Student 2.Name 3.Watever 1.12 2.XyZ 3.PPP Please help... | |
A fun little program that uses your internal motherboard speaker or "Beep" speaker and your keyboard to make a musical instument very similar to a musical KeyBoard. | |
Hi, I just started learning more about class/objects. What is the purpose of using 'this' pointers and static members? How exactly do you use them? These are some small examples: [CODE]class SomeClass { private: int num; public: void setNum(int num) { this->num = num; } }; [/CODE] What is 'this->' … | |
Alright no more prime number generators I promise, but I had to fix the last one... This one uses the Sieve of Eratosthenes algorithm. It can generate prime numbers even faster, than the previous version. 1 million prime number in 2,331 second, ten million prime number in less than 22 … | |
I am thinking of learning C++ (I already know Python and Java), and a friend of mine is thinking of learning C# (already knows some Java and JavaScript). I know there is a long debated "C++ or C#" ordeal out there, so I am not asking about that! :) (I've … | |
we had an assigment a few months ago to build a sodoku solver recursively so here it is.... i hope noone was bored enough to build one already. [CODE]//////////////////////////INCLUDES////////////////////////////////// #include <iostream> #include <cstdlib> //////////////////////////////////INFO////////////////////////////// /* */ //////////////////////////////USING///////////////////////////////// using std::cout; using std::cin; using std::endl; const int N=2; //////////////////////////////////PROS////////////////////////////// int sodoku(int array[N*N][N*N], … | |
Right so what I'm trying to do is to take a text file i.e. in Notepad/MW from disk, encrypt it and transfer it to another computer where it will be received, decoded and stored on disk as a plain text file. I have to use the COM1 serial port to … | |
so im trying to build a connect 4 gameboard using charecter arrays and it has to look like this O | O | O | O ------------- O | O | O | O ------------- O | O | O | O ------------- O | O | O | O … | |
To anybody that may know and can help me. I am not looking for an answer to anything I just need to know to write this equation in C++ | |
[CODE]/* Beginning Game Programming, Third Edition Chapter 3 Direc3D_Windowed program */ #include <windows.h> #include <d3d9.h> #include <time.h> #include <iostream> using namespace std; #pragma comment(lib,"d3d9.lib") #pragma comment(lib,"d3d9.lib") //program settings const string APPTITLE = "Direct3D_Windowed"; const int SCREENW = 1024; const int SCREENH = 768; //Direct3D objects LPDIRECT3D9 d3d = NULL; LPDIRECT3DDEVICE9 … | |
I have to write this program, and I am not sure exactly how to write the functions and where to put what. I have tried several times, and decided to start over from the beginnning. What i have so far is at the very bottom. Here is the prompt: Overview … | |
Not sure what the exact title should be. But at a point in my text game. I want to have multiple selections. But whenever I put the code (shown below), compile the program, and run it I get this. It goes through my main menu, new game, all the stuff … | |
[CODE]if (option == 3) { { pmt = (percentage * earnings); cout << "pmt is " << pmt << endl; wr = (0.06 / 52.0); cout << "wr is " << wr << endl; n = (52 * actualage); cout << "n is " << n << endl; retirement = … | |
Hey Guys I was wondering if anyone can help me with this assignment like completely walk me through it? I would really greatly appreciate it....... I have tried doing it and have came up with nothing. I have been having a lot of trouble understanding this material this school year. … | |
Hi, I'd like to learn some basic graphics (2D) that would be easy to use and quick (So no OpenGL, or Direct X). Also, it NEEDs to have Linux portability. I've already tried Allegro and paintlib, neither of them could I install and they didn't look quite as easy as … |
The End.