Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #27.9K
Ranked #3K
~4K People Reached
Favorite Forums
Member Avatar for brynjar

Hi, I'm pretty new to C++ but have a lot of experience in Python. In python its pretty straight forward to make functions that both take arrays/vectors as input and return arrays/vectors. My thought here is to make a function to calculate the gravitational force between to bodies with mass …

Member Avatar for lcordero
0
224
Member Avatar for merse

How to initializing a const set with list of values? I want to initialize in the preambulum, so I dont want to define and initialize an array before initializing the set. I want to do this in one row, if it is possible.

Member Avatar for lcordero
0
2K
Member Avatar for montjoile

I have this structure: [CODE] typedef struct nodo{ int dato; struct nodo *izq; struct nodo *der; }nodo; typedef struct nodo *avl; [/CODE] I have this method: [CODE] void insertar(avl *r, int dato){ if (*r==NULL){ *r=(nodo*)malloc(sizeof(nodo)); (*r)->dato=dato; (*r)->izq=NULL; (*r)->der=NULL; [/CODE] All this code works perfectly. My question is about the line: …

Member Avatar for montjoile
0
115
Member Avatar for thierrypin

I have this problem: I have a data structure called DACT, that I convert into a string line and send to another computer. I have a file full of DACTs, and I need to send them all to another computer. When I send only 100, it works fine, but when …

Member Avatar for thierrypin
0
186
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 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
541