49,757 Topics

Member Avatar for
Member Avatar for ilnura

ookay people, here is the code c++; im trying to read BMP image file. [CODE]#include <iostream> #include <fstream> using namespace std; void listing (void) { unsigned char pixel; int x, pix; ofstream debug("debug.txt", ios::out); ifstream inpaint( "source.bmp",ios::binary); if(!inpaint) { cout << "File not opened\n"; exit(1); } for(x=1; x<=54; x++) { …

Member Avatar for ilnura
0
144
Member Avatar for Jimmyteoh

. A small airline has just purchased a computer for its new automated reservation systems. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 10 seats) Your program should display the following …

Member Avatar for Narue
-1
925
Member Avatar for sadsdw

Hi, I would like to ask about sorting lines in C++, (4 columns = 3 columns of integers and the last one a string): 3 56 3 NA 7 50 5 NA 2 100 1 OK I tried the function sort() using a vector of strings, but failed in cases …

Member Avatar for sadsdw
0
2K
Member Avatar for shyla

I can't get rid this error IntelliSense: cannot open source file "stdafx.h" error C1083: Cannot open include file: 'stdafx.h': No such file or directory [CODE]#include "stdafx.h" #include <iostream> #include <cstdlib> using namespace std; //class BinarySearch Tree class BinarySearchTree { private: struct BST { BST* left; BST* right; int data; }; …

Member Avatar for Narue
0
965
Member Avatar for hanvyj

Hi, I am trying to use some C# code I have written in C++ - its worked fine in the past (without inheritance) so I'm totally stumped by this problem I'm getting. I have made a really simple version, which demonstrates the problem, specifically when it goes into any COM …

Member Avatar for hanvyj
0
149
Member Avatar for a.muqeet khan

guys here is the question elow is the main function that creates the object of Mile and Kilometer classes. Write the definition of Mile and Kilometer classes such that each statement in the main function is executed without any error. Both classes must have default constructor that initialize the private …

Member Avatar for a.muqeet khan
0
97
Member Avatar for Tellalca

Hey; I am trying to handle the SIGCHLD and therefore prevent zombie processes walking around .) The program does not work the way it should however. I am counting how many times the ZombieHandler is called and at the end of the program it says zero. What might be causing …

Member Avatar for rubberman
0
2K
Member Avatar for MixedCoder

is there is a tutorial about how to use boost:asio how to send how to recive , coz all the tutorials i checked is only showin me an example of server source or a client source. so please if there is one link me to it thnx alot :)

0
111
Member Avatar for iwishimgoodasu

(C++)I need to create a program that would input year and month in number. Display the year and the number of days in that month. The hard part is I need to include the leap year e.g. if the input year is 2000 and the input month is 2 (which …

Member Avatar for iwishimgoodasu
0
164
Member Avatar for Jimmyteoh

. A small airline has just purchased a computer for its new automated reservation systems. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 10 seats) Your program should display the following …

Member Avatar for peter_budo
-3
123
Member Avatar for dboltz03

Hi all, Recently I've run into a problem where a string I am reading from a file is being read in with a nonprinting character appended to the end. The character being appended is U+0020. I'm just unsure how to get rid of this. I know that I could just …

Member Avatar for vijayan121
0
2K
Member Avatar for vidit_X

I wrote a program which finds the next palindrome. First, it takes an input specifying the number of test cases. The code runs fine in Visual C++, but am not able to run it in GCC. I have never used GCC before so unaware with its functioning. But am expecting …

Member Avatar for pseudorandom21
0
239
Member Avatar for thekashyap

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. [COLOR="Red"][B]A brief on problem:[/B][/COLOR] Lets take example problem for simplicity: - I have a GSM network with a cell in it. - Cell's coverage …

Member Avatar for thekashyap
3
573
Member Avatar for Real Engineer

hi i need your help in these programs using C++ programming language. 1.write a program to enter some numbers and display the count of how many odd and how many even you entered. 2.write a program to store 10 numbers in an array and then display the sum of digits …

Member Avatar for mohamads
-1
258
Member Avatar for M1n1m@l1$t

I am really new to c++ just started today. This is my first real program (however useless it is) and i am stuck with one error. I am writing my code on code::blocks using mingGW on windows XP. My error is as following-invalid converion from 'const char*'to 'char'. my code …

Member Avatar for M1n1m@l1$t
0
3K
Member Avatar for idk

I am trying to run the following simple program which uses multithreading using pthreads. I compile it like: gcc -lpthread programName.c and it compiles fine. However, when I run it gives errors which I have pasted at the bottom of program. [code]#include<pthread.h> #include<stdio.h> void *thread_routine(void* arg) { printf("Inside newly created …

Member Avatar for idk
0
235
Member Avatar for khsheehan

So I always seem to encounter this error. I usually find some odd hackish fix for it but this time I'm having too much trouble. I'm basically trying to make a program which corrects words the user types in (similar to that of any modern phone). The function I'm posting …

Member Avatar for arkoenig
0
153
Member Avatar for whocares21

Hello I want to implement a pr. queue with structs. My struct is: [CODE] struct Call { int CallNum; long CallTime; int CallLength; };[/CODE] This is a call center simulation application (of course if i can). According to algorithm, the agents should choose the call whose CallLength is shorter. I …

Member Avatar for rubberman
0
85
Member Avatar for lexusdominus

Ok so ive written a console program which is great, and now i want to create a thread that makes a window (winAPI) and can commuunicate with the console window. Well to describe it properly, i would like the window thread to send predetermined text (by clicking buttons) to the …

Member Avatar for octopusgrabbus
0
90
Member Avatar for adam.com

dear all i have a dll with COM METHOD functions i want to call.i know the prototype and parameters of each fun. and also return type can anyone help me in calling these functions in details please because i am a beginner in this part. i use vs2010 thanks in …

0
100
Member Avatar for andylbh

For example I have 4 sets of Coordinates [CODE] (1,1) (1,3) (3,3) (3,1)[/CODE] It's the out line of a Square Shape Is there a way I can find the list of sets of Coordinates on it's parameter? The expected out put should be: [CODE] (1,2) (2,1) (2,3) (3,2)[/CODE] and is …

Member Avatar for StuXYZ
0
160
Member Avatar for predator78

Need some help here it seems to compile fine but crashes at runtime. Am I missing something here? [CODE] #include <iostream> #include <string> using namespace std; // player class class Player{ int *position; public: Player(); Player(int); ~Player(); void print_pos(){ cout << "player 1 is in position: " << *position << …

Member Avatar for predator78
0
89
Member Avatar for Jsplinter

Is there a better way to access the base class operator overload? I'm using casting, and it works just fine, just wondering if there is a better way. Is this bad/ugly code? [CODE]class StrategyKey { public: StrategyKey(){} ~StrategyKey(){} StrategyKey(const char* strA): str_strategy(strA) {} friend bool operator< (const StrategyKey& stratKeyA, const …

Member Avatar for mrnutty
0
173
Member Avatar for Billy D

[CODE]string currentUser() { string user; ofstream outf("CurrentUser.dat", ios::trunc); system("whoami >> CurrentUser.dat"); outf.close(); ifstream inf("CurrentUser.dat"); inf >> user; return user; }[/CODE] This is a function that gets the name of the current active user. It creates a data file, with the contents being the username. The problem is, to create a …

Member Avatar for TrustyTony
0
181
Member Avatar for Abelville

I need help with this program, I am new and i am loosing the battle. Write a program that contains a class that implements the days of the week. The program should be able to perform the following on an object of the class: 1. Set the day. 2. Print …

Member Avatar for enthuiastic
0
141
Member Avatar for NoUserNameHere

linked lists? I recently started learning about it and it is really confusing. What tutorial would you recommend?

Member Avatar for Narue
0
109
Member Avatar for pseudorandom21

Hello, I would like to use the QT LGPL version with my software, but I'm really not sure what I'm allowed to do with it. The license is very confusing. I'm hoping I can dynamically link to some QT DLLs and use them without too much GNU-tape. What other requirements …

0
74
Member Avatar for naveentiptur

Can anyone help me in parsing multipart foorm data.. Is there any third party lib or anyone has written some code??? waiting eagerly...

Member Avatar for GorelovGrigory
0
109
Member Avatar for stereomatching

I have some problems about promotion traits [code] template<typename T1, typename T2> class Promotion; template<bool C, typename Ta, typename Tb> class IfThenElse; template<typename Ta, typename Tb> class IfThenElse<true, Ta, Tb> { public : typedef Ta ResultT; }; template<typename Ta, typename Tb> class IfThenElse<false, Ta, Tb> { public : typedef Tb …

Member Avatar for stereomatching
0
163
Member Avatar for jeffpro

Hey guys, I'm looking for a way to obtain an SSD serial number and I'm not interested in the volume serial number. Thanks in advance, Jeff

Member Avatar for Clinton Portis
0
211

The End.