49,761 Topics

Member Avatar for
Member Avatar for pseudorandom21

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.

Member Avatar for mike_2000_17
0
770
Member Avatar for naseerhaider

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 …

Member Avatar for naseerhaider
0
175
Member Avatar for DaniwebOS

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 …

Member Avatar for Ancient Dragon
-1
135
Member Avatar for ddcc

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 …

Member Avatar for ddcc
0
169
Member Avatar for Jennifer84

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 …

Member Avatar for jonsca
0
355
Member Avatar for YodaMerlin

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 '{...}' …

Member Avatar for YodaMerlin
0
231
Member Avatar for YodaMerlin

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 …

Member Avatar for YodaMerlin
0
158
Member Avatar for ChaseRLewis

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?

Member Avatar for mike_2000_17
0
152
Member Avatar for eskimo456

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 …

Member Avatar for mike_2000_17
0
118
Member Avatar for TailsTheFox

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?

Member Avatar for VernonDozier
0
5K
Member Avatar for Despairy

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 …

Member Avatar for Despairy
0
1K
Member Avatar for rbduck09

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 // …

Member Avatar for rbduck09
0
1K
Member Avatar for caut_baia

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 …

0
134
Member Avatar for TailsTheFox

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for AODfan

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 …

Member Avatar for WaltP
0
118
Member Avatar for alokdhari

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...

Member Avatar for Ancient Dragon
0
93
Member Avatar for #include<DAN.h>

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.

Member Avatar for KumarUtkarsh
0
169
Member Avatar for SeePlusPlus2

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->' …

Member Avatar for arkoenig
0
149
Member Avatar for BevoX

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 …

Member Avatar for KumarUtkarsh
0
155
Member Avatar for WolfShield

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 …

Member Avatar for WolfShield
0
562
Member Avatar for Despairy

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], …

Member Avatar for Despairy
0
101
Member Avatar for amateur¬

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 …

Member Avatar for abhiattri.love
0
173
Member Avatar for beejay321

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 …

Member Avatar for WaltP
0
856
Member Avatar for rbduck09

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++

Member Avatar for rbduck09
0
242
Member Avatar for Khoanyneosr

[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 …

Member Avatar for Khoanyneosr
0
306
Member Avatar for jmcginny5

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 …

Member Avatar for jmcginny5
0
3K
Member Avatar for valestrom

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 …

Member Avatar for valestrom
0
278
Member Avatar for garber

[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 = …

Member Avatar for jonsca
0
153
Member Avatar for Menace 83

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. …

Member Avatar for Menace 83
-1
548
Member Avatar for jackmaverick1

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 …

Member Avatar for jackmaverick1
0
154

The End.