49,761 Topics
| |
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 … | |
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 … | |
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;} … | |
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 … | |
Is it possible to design a Web Browser using C/C++ in Turbo C++ compiler by network programming ? | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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?? | |
Im looking for a good free game engine writen in c++ where source code is included | |
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 … | |
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 … | |
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 … | |
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 … | |
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], … | |
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 … | |
| 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) { … |
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; … | |
i want program that get a string from usre an display it reverse lke this input (noor) ouptut (roon) | |
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: … | |
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... | |
[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 … |
The End.