49,756 Topics

Member Avatar for
Member Avatar for 344server

Hello List, I'm creating a Button where I want to add a function setActionOnReleased(func aFunction); From any class I'd like to instantiate this Button class and send it the function I want to execute. I found some reference to using member function pointers ( [url]http://bytes.com/topic/c/answers/569262-passing-function-argument[/url] ), but I'd like to …

Member Avatar for 344server
0
252
Member Avatar for EvolutionFallen

Ok I feel like this may be a dumb question, but I'm putting it out there anyway. It's been a while since I've worked with C++. What characters does C++ print for negative values of char? Positive values seem to follow ASCII, but ASCII is only 128 characters. So where …

Member Avatar for EvolutionFallen
0
107
Member Avatar for fuggles

I am using the Direct2D API to draw some graphics for my program. I have a function that I call every time the Window redraws that draws the frame. I can't hardcode every object to be drawn into the function, if I want it to be dynamic. What is the …

Member Avatar for mike_2000_17
0
97
Member Avatar for coolboss

#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} }

Member Avatar for arkoenig
0
107
Member Avatar for gisek

Hi, After a year of using c# and gaining object programming experience I decided to improve my c++ skills. What I particularly liked about c# was the way of dividing source into different files. It all just worked fine :). Now I want to do the same using c++. I'm …

Member Avatar for gisek
0
136
Member Avatar for badenpearce

Hi, I'm an experienced developer but not done much in c++ and wanted to get some basic database operations in my program, open, store, retrieve etc. Does anyone have any good links that could get me started? Thanks Baden

Member Avatar for Stefano Mtangoo
0
361
Member Avatar for saransh60

#include<iostream> using namespace std; class alpha{ private: int data; public: alpha(){} alpha(int a){data=a;} void display(){ cout<<data; } alpha operator =(alpha& a){ cout<<data; data=a.data; cout<<"\n assignement operator invoked"; return alpha(data); // is temporary object created is returned to a2 object ?//why it can't be returned by reference?what is the difference b/w …

Member Avatar for Narue
0
116
Member Avatar for cuteyginx

can you help me out in solving this problem... i'm in my 1st year college with the course of info tech... i'm having problems on solving this.. develop a program that will dtermine the gross pay for each of several employees. the company pays " straight time" for the first …

Member Avatar for Ancient Dragon
0
98
Member Avatar for kashifboy

i have a text file with known format. which is as fallow code ItemName Quantity 001 ABC 45 002 BCA 5 003 ACB 10 i want to [B]read and write[/B] the line [B]randomly[/B] according to the [B]need of a user[/B]. for example if user want to read the data of …

Member Avatar for Narue
0
83
Member Avatar for y2kshane

can i declare operator overloading function as a friend function? i did it and i get errors #include <iostream.h> class time { int h; int m; friend time operator +(time); public: void input(); time(); time(int,int); void display(); }; time::time() { h=0; m=0; } time::time(int a,int b) { h=a; m=b; } …

Member Avatar for Stefano Mtangoo
0
292
Member Avatar for srivardhanms

[code] #include <iostream> #include <fstream> #include <string.h> #include <ctype.h> const int SIZE=100; using namespace std; class Person { private: char name[30],address[50],phone[11]; public: friend ostream &operator << (ostream &os, Person &p); friend istream &operator >> (istream &is, Person &p); friend ofstream &operator << (ofstream &fos, Person &p); friend ifstream &operator >>(ifstream …

Member Avatar for mike_2000_17
0
2K
Member Avatar for newbie_to_cpp

Hi All, I am new to C++. I am practicing loops and i need some help. This one behaves strangely. What i want is for this loop to accept numbers from 1 to 4 for options (strictly numbers) and no other characters. When executed and run, if the input is …

Member Avatar for ceriamultimedia
0
98
Member Avatar for skshoyeb

Let me tell u, that I AM A NEWBIE to C++.. I want to use sound in C++ (I use Borland Turbo C++ 4.5 because, this is used in our college..) To use sound files, I browsed net and came to know that we may play sound using the sound(), …

Member Avatar for skshoyeb
0
485
Member Avatar for mrkaran

hi,, i am new to cimg how can i get and also set the coordinates of the image using cimg? i searched a lot but could not find it out thanks

0
58
Member Avatar for AutoC

Hi. I have a character array of the form "0abcdef" or "1defghi". I have to remove the first character and convert the rest to a string. So in this case, the strings would be abcdef and defghi. I know that saying string s(char array) does a direct conversion but I …

Member Avatar for AutoC
0
146
Member Avatar for ak_2005

hi!! I installed TurboC++ version 3.0 in my computer, which runs a WindowsXP OS.... the problem is... the turboc++ window opens in my screen but i am not able to use my keyboard as well as my mouse within its window, hence i am not able to work with it …

Member Avatar for shriniwas
0
5K
Member Avatar for mrkaran

hey guys im trying to write a simple program for displaying an image using opencv libraries but the program never compiles.. it says no such file or directory 'highgui.h' .. ive tried reinstalling and configuring both devc++ and open cv about twice but to no avail.. ive downloaded the latest …

Member Avatar for NicAx64
0
178
Member Avatar for daino

I'm having trouble even beginning to GUI program in C++. I'm using DevC++ with WX widgets and I've downloaded the DevPac. I really need something to help me understand the basics. For example. How would one go about creating a project and programming a GUI applicatin. Also, when you compile …

Member Avatar for Stefano Mtangoo
0
909
Member Avatar for therobot

I'm working with some objects given to me by the API for an architectural modeling program. When navigating the model, I get a set of Component objects. One of the data members of these Component objects is a set of Interface objects. I'm looking to search for a specific Interface …

Member Avatar for therobot
0
103
Member Avatar for newbie_to_cpp

Who make better programmers? Men or Women? :) Just curious coz all around the world, in academics, women surpass men. But in this field, i guess its men :). What you say? I am a male by the way!

Member Avatar for NicAx64
0
106
Member Avatar for harris21
Member Avatar for pdk123

Hello, Is the endianess can be for the nibble boundaries ? Because i have defined a class, and try to access the array with a pointer of class type. typedef unsigned char uint8; class A{ public: uint8 a:4; uint8 b:4; }; int _tmain(int argc, _TCHAR* argv[]) { uint8 temp = …

Member Avatar for pdk123
0
138
Member Avatar for Kanoisa

Hi everyone. Today i have been playing with templates and decided to make a generic question and answer function using templates to allow you to choose the return type for each call. Code below. [code] template< class T > T qAndA(const std::string Question,const T retType) { T retVar; std::cout<<Question<<std::endl; //ask …

Member Avatar for mike_2000_17
0
134
Member Avatar for Kakashi Hatake

[CODE]int main() { int ival=12 , ival2 = 14; int &ref=ival; ref = ival2; cout<<ref; return 0; }[/CODE] That code shows an o/p as 14? How is it possible ? i thought references were not reassignable ? 1 more thing- do references occupy seperate spaces in memory like pointers ? …

Member Avatar for Narue
0
1K
Member Avatar for NicAx64

Hi all, I got a idea! if you have open source project ideas please share them on this thread. There are many tons of open source projects out there in the internet. what here expected is fresher level complex code-bases. :TODO: requests are welcome. so the final year students who …

Member Avatar for mrnutty
0
186
Member Avatar for ganesh_IT

Hi guys, i am doing one accounting project. I use 3 binary files to store account holders information, login information and transaction. For mini-statement i need to read my Transaction binary file in backward. i dont know how to do ... My structure is [CODE] struct Transaction_Info { int AccountNumber; …

Member Avatar for Ancient Dragon
0
162
Member Avatar for Kakashi Hatake

Float can hold 6 significant digits and double 10 (this is how the book tells me). Consider this code i wrote to test : [CODE]int main() { double a=355979.567; //9 significant digits i think cout<<a; return 0; }[/CODE] The o/p is 3555980. i thought since 'a' is double it should …

Member Avatar for mike_2000_17
0
100
Member Avatar for caut_baia

Hi and thanks for reading.I'm trying to acces the master PLC of a CAN network using the windows api.It's become a nuisance since i cant' figure this out at all.I will try to be brief since i don't have the source code at hand. So i'm initializing a handle for …

Member Avatar for mike_2000_17
0
123
Member Avatar for mike_2000_17

Hi experts! I have the following code which I use for dynamically creating objects in one module (executable or shared object (.so or .dll)) and be able to delete it from any other module while enforcing the call to the delete operator in the original module where the object was …

1
150
Member Avatar for therstonsplace

im trying to open a .mov file in binary which is easy enough to do... i haven't coded in a while... but i reread the book i had in school on the chapter on fstream.... i am instantiating an fstream obj with ios::binary to open a .mov file... i can …

Member Avatar for therstonsplace
0
85

The End.