49,757 Topics

Member Avatar for
Member Avatar for gcardonav

Hi guys: I created this code to read two file get their input and post certain output. My problem is that C++ is sorting out my output from smaller to greater. Is there a way that I can get c++ not to sort out the output. Thanks: Gus Here is …

Member Avatar for Sky Diploma
0
265
Member Avatar for VernonDozier

OK, the eventual goal of my project is a kind of word insert/delete/replace. You read a file... "The quick brown fox jumps over the lazy dog." and you can delete all instances of "fox", replace "fox" with "cat", insert "giraffe" wherever you want, etc. Word processing stuff. So I figured …

Member Avatar for Sky Diploma
1
229
Member Avatar for tim8889

Hello everyone, tim here. I am trying to use/modify a program to model a material in a 2D space. The shape is not too complicated. Now my thought is, instead of drawing it using the functions(which give me a headache, considering the shape has to be split to many piece …

Member Avatar for tim8889
0
191
Member Avatar for Trepach

Environment: MS Visual Studio 2008. (Please transfer this thread to where it belongs.) Project type: Windows Forms Control Library. Goal: Get the pixel color from a given process' main window. Already achieved: I got the desired process's pointer by using [code]cli::array<Process ^>^ Proc = System::Diagnostics::Process::GetProcessesByName("Notepad");[/code] I believe I got the …

Member Avatar for Trepach
0
401
Member Avatar for MixedCoder

[CODE] try { boost::asio::io_service io_service; tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 13)); for (;;) { tcp::socket socket(io_service); acceptor.accept(socket); //how do i make a checker here if the client is not sending anything then server send or if the client sending then server recive } } catch (std::exception& e) { std::cerr << e.what() << …

0
69
Member Avatar for kashif inayat
Member Avatar for lexusdominus

[CODE]if ( initialize == "off" && Iminor > 20 || Imedium > 10 || Isevere > 5 || Ifatal > 0 )[/CODE] the string type 'initialize' is cout'ing "on" and all of the values right of the AND operator are TRUE. Why is the subsequent code block for the if …

Member Avatar for lexusdominus
0
128
Member Avatar for lexusdominus

[CODE]int thetime = time(NULL); string in; stringstream out; out << thetime; in = out.str();[/CODE] that's my code for casting an integer into a string, but im having a little trouble reversing it to change a string into an int. :/ can anybody help me out? you have to include the …

Member Avatar for lexusdominus
0
67
Member Avatar for EEETQ

Hi guys, I'm working on an assignment for my programming class and was wondering if I could get some help. The problem I'm having is that when I try to access the value of the map, I get a weird debug error. The program compiles fine but when I run …

Member Avatar for NicAx64
0
220
Member Avatar for Rocker Gang

Hi I am trying to open the system open dialog box by usinf CFileDialog class and i wanna display the image in my listcontrol,which(image) is selected from that open dialog box. I am able to get the file name of the selected image and i tried to Add it to …

0
50
Member Avatar for anaychowdhary

hi, I am looking for the code for the following program. Consider a set of elements and a given sum. You need to find a subset of elements whose sum equals or is greater[given there are more than one subset, print the one whose sum is closest to the number] …

Member Avatar for anaychowdhary
-2
171
Member Avatar for neilio86

I need to figure out how to get the min/max in this array. I heard that it can be done using the algorithm library. we have yet to learn that. any help would be appreciated. [CODE]#ifndef Lab4_h #define Lab4_h void GetTemperatures (int Temperatures[], int NumTemperatures); double ComputeAverageTemp (int Temperatures[], int …

Member Avatar for pseudorandom21
0
236
Member Avatar for Labdabeta

Is there any software out there that can help me create 3d models for use with OpenGL drawing of models (i.e: triangles, square and polygons in 3d space). I need to be able to make polygons in 3d and be able to access the values of the vertexes. Does anybody …

Member Avatar for mrnutty
0
107
Member Avatar for centerline00

Hello all, I am having a mental blank on checking user input (that is string) to check if it contains an integer value. as in: [code]for(i=0;i < nNames; i++){ cout<<"\nEnter a last name: "; getline(cin,name[i]); [/code] I have checked the C++ string class for string.length() and others, I am just …

Member Avatar for centerline00
0
261
Member Avatar for programing
Member Avatar for Narue
0
152
Member Avatar for Labdabeta

I decided to post this problem in a new thread. I have a simple program in OpenGL and it doesn't work. What happens is that a transparent window forms and when you hit the 'X' it says that the Release of the Device Context and Rendering Context failed. Here is …

Member Avatar for Labdabeta
0
197
Member Avatar for lexusdominus

Hey, ive got two string types [CODE] string string1 = '1'; string string2 = '2'; string string3 = string1 + string2; [/CODE] Ok, ive simplified my code. I would like string3 to equal '3', and not '12'. I dont know anything about casting. Please dont tell me to use an …

Member Avatar for lexusdominus
0
119
Member Avatar for Bitprior

Hello, and greetings to those I may be speaking with in this thread over time. I present to you a problem, rather fringed and minimal and troublesome. First, I'll start by saying that I don't really consider myself a programmer so much as I do an enthusiast who now, suddenly, …

Member Avatar for rubberman
0
194
Member Avatar for Jsplinter

I'm just starting a search for a library or code sample for grouping numbers together based on their distance from one another. For instance, in the set{1,2,4,25,28,29}, is there an algorithm that would identify two groups of numbers subsetA{1,2,4} and subsetB{25,28,29}? Nothing really came up in my google search, but …

Member Avatar for Jsplinter
0
253
Member Avatar for stupendousomega

I have a user input an integer... But if it's really long, it throws an exception and starts looping infinitely. How would I make it cut the number after the first 7 digits and only use that? Like, if I inputted 654897654321648435435135813513843513543514, it would only accept 6548976. Please help.

Member Avatar for mrnutty
0
211
Member Avatar for kutuup

I've trawled the internet searchiing for an explaination on how to do this. I'm working on an assignment and we are told to "transmit a whole object to the server". As far as I know, the send function of winsock2 only allows you to send data of type char, so …

Member Avatar for kutuup
0
490
Member Avatar for narlapavan

i am using QT software in solaris, i opened remote system through QFtp methods i.e.. connectToHost() after that, loged in through login(). now my problem is, i am trying to get data from remote system, through int get ( const QString & file, QIODevice * dev = 0 ) at …

Member Avatar for Topi Ojala
0
218
Member Avatar for Jimmyteoh

[CODE=java]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Plane extends JApplet implements ActionListener { JTextField input; JLabel prompt1, prompt2; JButton yesButton, noButton; int section, seats[], smoking; int nonsmoking, people; public void init() { input = new JTextField( 4 ); input.addActionListener( this ); prompt1 = new JLabel( "Please type 1 for …

Member Avatar for Nick Evan
0
209
Member Avatar for sachintha81

I have done pretty much all my programming using C# and very much a newbie to C++. However now I have to convert to C++ and is finding it a bit difficult. For example, I wrote a pretty simple program using C# to acquire a RegistryKey, then using a recursive …

Member Avatar for drkybelk
0
368
Member Avatar for montjoile

with this structures: [CODE]//Structure of binary tree typedef struct nodo_ab { int etiqueta; list primerapos; list ultimapos; char dato; struct nodo_ab* izq; struct nodo_ab* der; struct nodo_ab* padre; } nodo_ab; typedef struct nodo_ab *abb; //Structure of list typedef struct nodo_lista{ int dato; struct nodo_lista *sig; }nodo_lista; typedef struct nodo_lista *list; …

Member Avatar for montjoile
0
168
Member Avatar for miguelsan

I have had an issue with getline(cin,string) in several of my programs. The program does not allow the user to input information after the cout statement preceding getline(cin,string). Below is an example code of the issue I am having(Btw I am using code::blocks with GNU compiler): [CODE]#include <iostream> #include <cstring> …

Member Avatar for miguelsan
0
212
Member Avatar for chintan_1671

I converted old C++ project to VS.Net 2010 with 4.0 Framework. error C2440: 'static_cast' : cannot convert from 'void (__thiscall CChatView:: * )(LPARAM,WPARAM)' to 'LRESULT (__thiscall CWnd:: * )(WPARAM,LPARAM)' [CODE] // .cpp File ON_MESSAGE(WM_ChatAddSize, OnChatAddSize) void CChatView::OnChatAddSize(LPARAM lParam, WPARAM wParam) // .h file afx_msg void OnChatAddSize(LPARAM lParam, WPARAM wParam); [/CODE] …

Member Avatar for thekashyap
0
1K
Member Avatar for sadsdw

Hi everyone, I'm trying sort a C++ struct and print the result as output file. I don't know how to sort the structure. Did anyone develop this before? Thanks a lot, [CODE] #include <stdio.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <string> #include <vector> #include <sstream> #include <algorithm> #include <cstdlib> …

Member Avatar for sadsdw
0
119
Member Avatar for kchyn

Hi, can someone point me in the right way? I'm running linux and I'm looking for the right include files and commands that would enable me to configure my wifi card. ie create a ad-hoc with another computer, or connect to a wifi router. I don't want to do through …

Member Avatar for abhimanipal
0
325
Member Avatar for Ertzel

First of all, sorry if my title is not all that descrptive and if this has already been answered, I looked around but did not find it so I decided to make my first post/thread. I am working on a little offline game right now and what I'm trying to …

Member Avatar for Ertzel
0
1K

The End.