48,986 Topics

Member Avatar for
Member Avatar for FTProtocol

im just wondering how you use send() and recv() like: [code=cpp] bool blah() { if(recv(send("10.1.1.1", "HI"), szBuffer, sizeof(szBuffer)) { MessageBox(NULL, "WORKED", "??", MB_OK); return true; } else { MessageBox(NULL, "FAIL", "??", MB_OK); return false; } } [/code] i know that wouldnt compile but you get the point?

Member Avatar for FTProtocol
0
164
Member Avatar for boradbhavesh

I got following algorithm for finding permutation but I can't code it. Can any one can code this permutation algorithm in c++ using recursive method as below [I]bool nextPermutation(int array[])[/I] 1. The first permutation is the permutation represented by the sequence (1, 2, …, n). 2. The last permutation is …

Member Avatar for Salem
0
85
Member Avatar for afiq200990

Hey guys. Question is. I need an example of a working code for a multiset. Hope theres someone out there who can help me on this, kind soul. Probably a multiset with a set of a grocery lists; not numbers you know.. for eg... {eggs, tomatoes, onions, chicken, shampoo..etc} you …

Member Avatar for Undertech
0
127
Member Avatar for how1121

This program does not have any input. Instead, the main routine, called the driver, calls the Pay function, testing it with a variety of parameters. Your job is to write the function. It should calculate the rate of pay, but in this case, the function returns the amount of pay …

Member Avatar for ithelp
0
113
Member Avatar for CoolGamer48

Hey I'm writing a color class, and I want to have a constructor that can take in an unsigned int like 0x00FF00FF and interpret it as fully opaque green. I have code for that (I think it should work, could someone check it?): [CODE] rzb::color::color(unsigned int hex) { m_red = …

Member Avatar for ArkM
0
212
Member Avatar for Labombadog

Hi, I normally post at the IGN boards for games, but recently I semi-quited games(school reasons) and thought of getting serious with C++ because I want to become a game designer in the future. I know its going to take a lot of hard work and time but I know …

Member Avatar for mahlerfive
0
128
Member Avatar for scream2ice

hey all; is there a conversion from "char" to "int" or to "double" possible ? If yes, how? and if not, how do we work with numbers that have more than 32 digits, for instance a 500 digit number? thanks

Member Avatar for invisal
0
326
Member Avatar for jazu100

I have to send bitmap and do something like this: Client: [code] HBITMAP bmp = LoadBitmap(0,MAKEINTRESOURCE(1)); send(socket,(char*)&bmp,sizeof(HBITMAP),0); [/code] Server: [code] HBITMAP bmp; recv(socket,(char*)&bmp,sizeof(HBITMAP),0); [/code] But this won't work and I know it... so I have to use e.g. GetDIBits and SetDIBits. But how? Please don't give any example links, they …

Member Avatar for jazu100
0
208
Member Avatar for conan19870619

what is the easist way find out the number of lines in a txt file? there seems to be a function to ignore rest of the line...will that help?

Member Avatar for Radical Edward
0
188
Member Avatar for Wiki_Tiki

Hi everyone, I've been working on a word processor called 'Pen and Paper', and I need some help with the Find/Replace Dialogs. I'm using Visual C++ 2008 Express, and I have a Richtextbox control (txtdisplay) including a main menu. I've finished making everything such as save/open, New Document, but I …

Member Avatar for William Hemsworth
0
168
Member Avatar for mhil_joy

i have been given an assignment about palindromes but i don't no how to do the coding in c++ and using queue and stact to check if a string is a palindrome.. please help me guys.. i need all your knowledge about it!.. i need it as soon as possible.. …

Member Avatar for WaltP
0
52
Member Avatar for coveredinflies

Hi, I am sure you have all seen the recursive factorial program. [code] int factorial(int number) { int temp; if(number <= 1) return 1; temp = number * factorial(number - 1); return temp; } [/code] " Once at 1, the values are returned to the previous factorial call and multiplied …

Member Avatar for coveredinflies
0
149
Member Avatar for dmanw100

Is there an easy way to convert from Char* to int? I have tried converting as such: [CODE]char* value_a; int* temp = value_a; int final = temp;[/CODE] The compiler is returning an error so I know something is wrong but why can't I convert this way? Any suggestions as to …

Member Avatar for ArkM
0
177
Member Avatar for phillipeharris

I am trying to write the class that will take in objs from another class and put it into a circular array without using the STL. O I wrote the class and in Main I delcared an obj of the queue called (myQueue myQ) so this is the obj but …

Member Avatar for phillipeharris
0
93
Member Avatar for BradenMurphy

[CODE] string hello; cin>>hello; sprintf(buf, "This server has been contacted time%s\n", hello); [/CODE] I'm making a simple client-server program. I just want to know how do I get to print out the hello string inside the sprintf() >.< soz might be a very dumb question.... The error i keep getting …

Member Avatar for BradenMurphy
0
171
Member Avatar for mysterio

Question:-- Write a program that read a line of text, changes each uppercase letter to lowercase and places each letter both in a queue and onto a stack. The program should then verify whether the line of text is a palindrome Output: Please enter a line of text I am …

Member Avatar for mhil_joy
0
3K
Member Avatar for dmanw100

I have a problem that seems like it should be easy but so far has been fairly difficult to find documentation on... I want to be able to pass parameters to a program in the command line in the same manner as the built in functions (ex. the "/r" in …

Member Avatar for Prabakar
0
116
Member Avatar for krebstar

Hi.. I have a question regarding the configuration manager.. Why is it that the samples on the MSDN Learning center cannot be compiled using the default settings? With Itanium as the active solution platform by default, the compiling gets skipped.. However, when I change this to Win32, it compiles.. Isn't …

Member Avatar for krebstar
0
108
Member Avatar for sym

I read that STL containers will allocate elements in the heap but the container objects are allocated in the stack. Therefore, in the code below do I need to first clear off the elements of vector "vec" from the heap before deleting "sub" in order to avoid memory leak? Or, …

Member Avatar for sarehu
0
126
Member Avatar for HyperEngineer

I'm trying to read a com port. I can create it, change the dcb, set the timeouts and see the input buffer using ClearCommError. But I can not read it. When the program hits the ReadFile() statement it never comes back. Here is some of the code: [ICODE] char CMyClass::EIA232_Open(HANDLE* …

Member Avatar for Ancient Dragon
0
185
Member Avatar for verone

this is wat i hav been doing but its not workin.i am not able to write the code for searching #include<iostream.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<string.h> //***Record structure declaration*** struct Details { char name[30]; char sex; char status; char title; char address[40]; char qualification[10]; char experience[20]; int telephoneno; int membershipno; int …

Member Avatar for Lerner
0
120
Member Avatar for Prm753

Hi all, I am trying to optimize one of my applications by cutting down on the number of function calls I am making. I have decided to do this by reading definitions out of a file and using them as the argument for the function. [code] char registryHive[MAX_PATH]; ZeroMemory ( …

Member Avatar for ArkM
0
139
Member Avatar for veeran

in VC++ 2005 I tried to create directory using CreateDirectory(_T("c:\program files\Testing")) But it is not created in c:\program files\ it is created in loged in Users appdata folder how can i overide this senario in vista (windows folder and System directory) please give any link or information

Member Avatar for William Hemsworth
0
186
Member Avatar for disturbedfan

Ok so ive strted to try and teach myself C++ cause in a few years when i go to college i wanna study computer science or engineering. I downloaded Dev C+++ and followed some small simple tuts on how to do C++. 2 of the tuts started off simple and …

Member Avatar for gregorynoob
0
136
Member Avatar for daviddoria

I want to be able to do this: Pass a parameter to my main program like "parallel = yes" and then many functions down in the hierarchy (ie main calls "Function1" which calls "Function2" which calls "Function3", etc) I need to see the value of "parallel". I'd hate to have …

Member Avatar for Radical Edward
0
97
Member Avatar for disturbedfan

[code] #include <cstdlib> #include <iostream> #include <string> using namespace std; string name = ""; int main(int argc, char *argv[]) { cout << "Hi, whats your name? "; cin>>name cout << end1<< "Well Hello " << name.c_str() << "Please provide me two numbers on 2 seperate lines "; cin>>number1; cin>>number2; cout(number1+number2) …

Member Avatar for Radical Edward
0
103
Member Avatar for The Buzzer

hi guys, hi bosses, I am in real trouble. I have to finish my program by tonight, look out to my threads and give me a solution pls. I will be greatful to those who will give me a quick reply. Cheers

Member Avatar for The Buzzer
0
64
Member Avatar for gispe

hi ppl, im havin a problem with declaration of functions, its givin me errors on the functions i made. [code=cplusplus] // empleados.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using std::basic_iostream; char menu (char); void ingresar_legajo_hijos (int &, int &); void ingresar_horasTrabajadas_valorHora (int …

Member Avatar for gispe
0
117
Member Avatar for sciwizeh

is it possible to use the Dev-C++ compiler with Netbeans? if so how, i can't find anything that explains it.

Member Avatar for sciwizeh
1
381
Member Avatar for kinger29

I have two files sampleclass.cpp and sampledataclass.cpp along with sampleclass.h and sampledataclass.h In sampleclass.cpp in the constructor I give a value to a variable [B][U]sampleclass.cpp[/U][/B] sampleclass:sampleclass(){ x = "some string value"; } In sampleclass.h I create x and an instance of the data class [B][U]sampleclass.h[/U][/B] CString x; sampledataclass myDC; Now …

Member Avatar for ArkM
0
132

The End.