49,756 Topics
| |
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 … | |
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 … | |
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 … | |
#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} } | |
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 … | |
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 | |
#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 … | |
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 … | |
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 … | |
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; } … | |
[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 … | |
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 … | |
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(), … | |
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 | |
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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
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! | |
Is there any concept of pure virtual destructor in C++? | |
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 = … | |
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 … | |
[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 ? … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.