- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 11
- Posts with Upvotes
- 10
- Upvoting Members
- 8
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
:)
- Interests
- C++,Algorithm
- PC Specs
- Linux
I have to learn how to deal with socket programming because of my job(I don't have any experience about it) My company ask me to learn ACE because I have to maintain our ex and new products After I google the information from the internet, most of the users say … |
|
Below is part of the source code of an allocator from the sgistl(2.91.57) [CODE] void ( *set_malloc_handler( void(*f)() ) ) () { } [/CODE] The purpose of this function is mimic the behavior of set_new_handler. But i don't know what is the meaning of this function. return type = void … |
|
I need to write a program, which prints out all the prime numbers between two numbers. The first input specifies the number of test cases, followed by the limits. Here is an example.. [QUOTE] Input: 2 1 10 3 5 Output: 2 3 5 7 3 5 [/QUOTE] I wrote … |
|
Hi everyone again :) Bit of a weird problem, but is there any way of counting how many keys are stored within a multimap? Say for example I have the keys A, B, C and D. Each of these keys have say 100 values for each, so there should be … |
|
there are 2 common ways to loop through a vector 1: [CODE] vector<int> myvec; // let's assume it's initialized for(int i = 0; i != myvec.size( ); i++) { // code // access by 'myvec[i]' } [/CODE] 2: [CODE] vector<int> myvec; // let's assume it's initialized for(vector<int> :: iterator i … |
|
hii,i have to know about performance measurement and improvement library.itz our project topic for btech.plz give an idea about the topic. content:how to improve a c++ program by calculating fn call,fn time,memory allocation and save pointers |
|
... this is your favorite pickup line: "Hey sweets, does this rag smell like chloroform? " |
|
[CODE]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 A * * * * * * * * * * * * * * * * * * * * B * * * * * * * * … |
|
This is what I read about it. [CODE] virtual base class becomes common direct base for the derived class [/CODE] So my question is exactly what does this mean. What I believe it means. [CODE] class A { protected: int a; public: virtual int get_a(); A(void); ~A(void); }; [/CODE] With … |
|
I found some implementation by macro with the help of macro I may write something like [code] #define DEFINE_LIST(type) \ typedef struct list_node_##type { \ struct list_node_##type *next; \ type data; \ } int main() { DEFINE_LIST(int); // defines struct list_node_int DEFINE_LIST(double); // defines struct list_node_double IMPLEMENT_LIST_INSERT(int); // defines list_int_insert … |
|
Hi friends If we will override nonstatic methods or if we will overload non static methods means shall we say it is the run time polymorphism? If i will override static method means, friends are saying it is not compile time polymorphism, It is method hiding. I need some examples … |
|
Im having some problem in shuffling the deck. There are some repetition after it shuffle. Any solution for it>? [CODE] #include <iostream> #include <windows.h> #include "stdlib.h" #include <cstdlib> #include <ctime> using namespace std; const static int BLACK = 0; const static int BLUE = 9; const static int RED = … |
|
Hi, I was thinking of writing this post as a reply of [URL="http://www.daniweb.com/software-development/cpp/threads/375854"]Need small example for compile time polymorphism and runtime polymorphism in c++.[/URL] But later decided to open this new thread as some expert may want to give some expert opinion on this. On the above mentioned thread, mike_2000_17 … |
|
Any ONE who can solve this problem.... "Permutations: The challenge is to find the algorithm used to create all possible permutations of a given string" |
|
Hi all! After surfing the web I ended up here as I could not find a good answer! I am writing an application with c++ and gtkmm. I want to access the network card and listen on all ports for packages. As far as I have found out it is … |
|
Im getting a bunch of errors from the compiler.Not sure what im doing wrong.... Header File [CODE] #include<iostream> using namespace std; #ifndef STACK_H #define STACK_H template<class stackElem, int maxSize=80> class stack { public: stack() { top=-1; } bool push(const stackElem &item); }; #include "stack.cpp" #endif [/CODE] this is the .cpp … |
|
I need a little help with algorithm for my code.Given a word "abacus" i have the code to find all its anagrams but i need to include also the words that are smaller in length than the original word. That is, I wanna be able to list ABA,AAB,ACA....ABAC,ABCS....so on. Thanking … |
|
Hi, I'm pretty new to C++ but have a lot of experience in Python. In python its pretty straight forward to make functions that both take arrays/vectors as input and return arrays/vectors. My thought here is to make a function to calculate the gravitational force between to bodies with mass … |
|
Mike_2000_17 and Narue Just a thought: You should write a beginner's tutorial on C++0x for Daniweb. That will be a great way to promote this site. I can also contribute on some easier topics!!. |
|
PLease help me with these questions, I was interviewed for thses just today Q1)Can we delare constant data members inside a class? Q2)does friend function violates encapsulation/data hiding? Q3)what are the types of polymorhphism you know? Q4)why do you need virtual functions? Q5)Can we do something like\ int & = … |
|
Hello, Where can I find the source code/implementations of STL library? Thanks. |
|
Hi all! I get the following error while trying to compile this code /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_numeric.h:116: error: must use .* or ->* to call pointer-to-member function in `__binary_op (...)' I am quite stunned because I've used before in a similar way Can any body give me a hint? Thank you in advance! … |
|
Hi Coders, I was just trying out a simple singleton class. I have wriiten the below code. Now My que is : How do I instantiate the class from main function. PLS HELP :) [CODE] class MOV{ private:static MOV* inst; MOV(){cout<<"Hellooooooo\n"<<endl;} public:static MOV* get_it(){ if(!inst){ MOV *p=new MOV; cout<<"1st instance … |
|
Hi, Firstly, sorry about the large amount of code in this question. OK, so I'm making a C++ wrapper for the [URL="http://www.gnu.org/software/gsl/manual/html_node/Matrices.html"][icode]gsl_matrix[/icode][/URL] struct and its associated functions. To make my approach a bit easier to extend to other kinds of gsl structs, I have a template base class called [icode]gsl_base[/icode], … |
|
have planned to write my own light weight MVC for PHP, that will be used as base for my sites I develop. I have no problem with PHP, OOP, et al. I have trouble on how to actually load Models In controllers and use them amd loading Controller values into … |
|
Hey , i am new to data structure and specially Graph . And i was going through a problem for finding the best path [url]http://www.codechef.com/JULY11/problems/LOKBIL/[/url] And couldn't think something usable. SO , if u guys help that will be a good start of me on this site too. PS i … |
|
Hi all, I've been struggling with something for a number of weeks now and I just can't seem to solve it. I've got a bit of code that looks as follows: [CODE] class classA { public: classA( ); ~classA( ); classBBase* pointerToClassBBase; protected: private: }; class classBBase { public: classBBase( … |
|
[code="C++"] class item { string name; string identifier; public: item( string name,string id):{this->name=name;this->identifier=id;} friend ostream& operator<<(ostream&, const item&); friend istream& operator>>(istream&, item&); }; ostream& operator<<(ostream& out, const item& temp) { out<<item.name<<" "<<item.identifier<<endl; return out; } istream& operator>>(istream& in, Cmessage& temp) { getline(in,item.name);//in case sring has space char getline(in,item.identifier); return in; … |
|
I'm not known to be a very memory friendly guy but after about 4 hours debugging my lua+sdl in C++ I finally figured out how to use threads but now I have another problem. I apparently have zero knowledge of memory manangement but thats kind of ok so I've narrowed … |
|
I have a class Node and want to declare an initially unknown number of instances of this class at run-time. First the program determines the number of nodes (num_n) from the user and then I want to define num_n objects. I have crudely got around this by defining a maximum … |