49,757 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
[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() << … | |
Can We find any Number through binary search in 33 size array? | |
[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 … | |
[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 … | |
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 … | |
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 … | |
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] … | |
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 … | |
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 … | |
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 … | |
hi plz i wanna ask how i can print stack from bottom to top ... :( ? | |
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 … | |
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 … | |
| 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, … |
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 … | |
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. | |
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 … | |
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 … | |
[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 … | |
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 … | |
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; … | |
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> … | |
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] … | |
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> … | |
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 … | |
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 … |
The End.