49,761 Topics

Member Avatar for
Member Avatar for sajay

Hello I'm coding an algorithm based on genetic programming with tree structures in C. I implemented tree structure using recursive structure pointers **The traditional way** [CODE] struct tree { int val; tree *left; tree *right; }; tree a[10]; tree b[20]; void main() { generate (); // this generates me 10 …

Member Avatar for sajay
0
187
Member Avatar for Saad234

So for my project, I am doing my coding on Python and mainly C++, then I have a GUI interface form made on VB, so how do I link all these things together for a final product? PS: Someone told me about DLL's I don't know what that is, could …

Member Avatar for mrnutty
0
230
Member Avatar for programing

i am write a code to print element in stack in reverse order i need two stack to push from first and pop to other but i have something error .. [CODE]#include<iostream.h> #include<process.h> struct stack{ stack s1,s2; int info; }; class stacks { private: stack top; int x; public: s1.stack(){top=-1;} …

Member Avatar for raptr_dflo
0
227
Member Avatar for martin111

Hi. Visual C++ reports error 2440 for the following code: struct a_t { int i;}; struct b_t:a_t { int j;}; b_t* pb = 0; a_t* const * ref_pa = &pb; // Error 2440 reported for no reason at all. I cannot see why this should give an error, the base …

Member Avatar for mike_2000_17
0
299
Member Avatar for heshan86
Member Avatar for sergent
0
76
Member Avatar for sim08u

Hi guys this is the first time ive posted to this forum, and ive tried getting my answer by asking others and google, but what i'm after is to complete an assignment that is asking me to complete a program that basically works as an ATM machine. it reads in …

Member Avatar for raptr_dflo
0
3K
Member Avatar for eskimo456

Hi there I am having a frustrating and strange problem. I am building a particle system. As a result I need particles to reset there variables to be reintroduced into the system. I have had it working in the past. I run through the system once, when the particles pass …

Member Avatar for eskimo456
0
150
Member Avatar for JordanHam

I have a basic questions. I have written a program in C++ and I would like to create a GUI for it. I have a book Microsoft Visual Basic C++.net that has a great tutorial, but its in clr/c++. Is it possible to program a GUI in this language in …

Member Avatar for drkybelk
0
192
Member Avatar for Labdabeta

I am having some major issues with OpenGL textures. I have the following code to load a glTexture (typedef ed as a GLuint): [CODE]glTexture LoadBMP(const char *fname) { HBITMAP hBMP; BITMAP BMP; glTexture texid; glGenTextures(1, &texid); hBMP=(HBITMAP)LoadImage(GetModuleHandle(NULL), fname, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE ); if (!hBMP) return NULL; GetObject(hBMP, …

Member Avatar for mike_2000_17
0
222
Member Avatar for Osas106

good day all am osagie by name. i have just developed my first mfc app. now i want to go ahead to sell it to people. but : 1.how can i write a batch or whatever that will automate d installation of this product? 2. i also want to implement …

Member Avatar for abelLazm
0
82
Member Avatar for cppgangster

Hi dudes, I currently learning mfc and I wrote a modeless dialog canculator app for my job. As soon as I tried to launch the app I get error msgbox saying "inoretly installed app.."(the exe file was copied to another conputer). My target OS is xp 32, while I am …

Member Avatar for cppgangster
0
161
Member Avatar for rtr18

Hi! I'm trying to open a URL from a Dialog in MFC with the following code. [CODE]CWebBrowser2 m_WebBrowserCtrl.Navigate(URL.c_str(), NULL, NULL, NULL, NULL);[/CODE] But it navigates to the URL at the computers where IE is installed. Otherwise it's not working. I've to read the default browser from Regsitry and open the …

0
45
Member Avatar for jimJohnson

I have a program due tonight and the GCD keeps returning a 0 but when I change the following to like 2 or 3 instead of 0 it will return a 2 or 3 for gcd so something is not passing right. Can someone please show me what I need …

Member Avatar for jimJohnson
0
184
Member Avatar for SCass2010

Hi everyone, I've recently started learning C++ and was wondering does anyone know any good networking tutorials for C++? I've tried searching but alot of them seem to be a bit over-complex - I've done network programming with Java in uni and a good bit of C++, but was hoping …

Member Avatar for Mouche
0
215
Member Avatar for Swiftle

Hi! I'm trying to use a base class derivative in another derivative class constructor but it's not working. Here's what I have: [CODE] class A { ... }; class B : public class A { ... }; class C : public class A { C(A objA); } [/CODE] However when …

Member Avatar for Mouche
0
193
Member Avatar for kutuup

I have no idea what is going on here, first, the code: [CODE] #pragma once #include <stdio.h> //#include <stdafx.h> #include <allegro5/allegro.h> //#include <allegro_image.h> class DisplayController { public: int bitmapx; int bitmapy; // ALLEGRO_DISPLAY display; ALLEGRO_BITMAP *crosshairs; ALLEGRO_EVENT ev; ALLEGRO_EVENT_QUEUE *event_queue; void display() { this->event_queue = al_create_event_queue(); al_register_event_source(event_queue, al_get_mouse_event_source()); al_wait_for_event(event_queue, &ev); …

Member Avatar for kutuup
0
1K
Member Avatar for montjoile

Why I can't compile without the [B]using namespace std[/B] line? I need to add .h in some libraries in order to being recognized by G++, but some others works without the .h extension. Why is that??

Member Avatar for Duoas
0
271
Member Avatar for resell4

Im looking for a good free game engine writen in c++ where source code is included

Member Avatar for roswell1329
0
75
Member Avatar for RobBobSmith

Hi all: I would be very grateful for advice on an Xcode (3.2.2) problem. I use Mac OS X 10.6.7. I have written C++ code that requires outside code. The outside code 1) requires a license and 2) has dynamic libraries. The outside code does run in a terminal, but …

0
154
Member Avatar for FoxInBoots

I've tried to search for a simple formula to do this but I can't find any that works for my program. I found this: (n^2+n)/2=sum, n being the last number in the "series", but it only works if the first number is 1(which mine is necessarly not, since you should …

Member Avatar for FoxInBoots
0
2K
Member Avatar for vanalex

Hello everybody! I have two questions about pointers and would be grateful if someone gave me some help. 1. When we use a table's name as a parameter the table is used as an address (the address of its first element). I mean, when i call a function that has …

Member Avatar for vanalex
0
109
Member Avatar for lexusdominus

Hey, so im making this game, and at the moment im using PlaySound() which is a function of windows.h to play my sound files. Ive got a problem though, i now want to be able to play more than one sound at the same time, and only now do i …

Member Avatar for predator78
0
171
Member Avatar for Haranadh

Can some one suggest best way to calculate the huge matrix. Example: [CODE] const int NUMPAT = 1212; const int NUMIN = 6; const int NUMHID1= 13; const int NUMHID2 =15; const int NUMOUT = 12; #define rando() ((double)rand()/(RAND_MAX+1)) [/CODE] Below are----- [CODE] double Input[NUMPAT+1][NUMIN+1]; double Target[NUMPAT+1][NUMOUT+1]; double SumH1[NUMPAT+1][NUMHID1+1], WeightIH1[NUMIN+1][NUMHID1+1], …

Member Avatar for mike_2000_17
0
307
Member Avatar for IMJS

Hello, please can I have some clarification to check I am not doing something very stupid? It seems sensible with all that I have read, but I'm not confident. I suspect I have memory leaks and want to make sure some fundamentals are correct before I start looking deeper. My …

Member Avatar for mrnutty
0
182
Member Avatar for stinkypete

I am trying to catch EN_VSCROLL (vertical scroll) messages from a richedit control. So far I have done the following: In the form's oncreate: [CODE]int mask = SendMessage(richedit->Handle, EM_GETEVENTMASK, 0, 0); SendMessage(richedit->Handle, EM_SETEVENTMASK, 0, mask + ENM_SCROLL); Application->OnMessage = AppMessage;[/CODE] My onmessage function is: [CODE]void form::AppMessage(tagMsg &Msg, bool &Handled) { …

0
68
Member Avatar for FoxInBoots

I've tried but I don't understand how to use void, can someone please try to explain how it works in a simple way. [CODE] #include<iostream> #include<conio.h> #include<iomanip> using namespace std; float areacalc( float rad); float circumcalc( float rad); void output(float A, float C); void input ( void ); float radius; …

Member Avatar for FoxInBoots
0
157
Member Avatar for jory

i want program that get a string from usre an display it reverse lke this input (noor) ouptut (roon)

Member Avatar for predator78
-1
105
Member Avatar for dan2011

I'm a newbie at C++. I can't figure out why my program won't build. Could someone please help? I get the error [QUOTE]1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup 1>c:__namestuff__.exe : fatal error LNK1120: 1 unresolved externals[/QUOTE] [CODE]// File : name.cpp // Description: Does stuff with stock // Programmer: …

Member Avatar for predator78
0
82
Member Avatar for pseudorandom21

Do any of you know of a plugin for VS2010 that plays music? I'm kind of assuming plugins for VS are written in some kind of native code...

Member Avatar for pseudorandom21
0
100
Member Avatar for MixedCoder

[CODE]Server::Server(boost::asio::io_service& io_service,std::string ip,short port,std::shared_ptr<ConnectionFactory> factory) : acceptor_(io_service, boost::asio::ip::tcp::endpoint(boost::asio::ip::address_v4::from_string(ip.data()), port)){ m_factory = factory; start_accept(); std::cout<<"Socket accepting connections..."<<std::endl; } Server::~Server() { } void Server::start_accept(){ boost::asio::io_service io_service; std::shared_ptr<Connection> conn = m_factory->create(io_service); acceptor_.async_accept(conn->socket(), boost::bind(&Server::handle_accept, this,conn, boost::asio::placeholders::error)); } void Server::handle_accept(std::shared_ptr<Connection> conn,const boost::system::error_code& error){ if (!error) { std::cout<<"on connected"<<std::endl; conn->OnConnected(); start_accept(); } } [/CODE] when i …

Member Avatar for lcordero
0
546

The End.