Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
operator<<
- Page 1
Paris Olympics Chatbot- Get Ticket Information Using Chat-GPT and LangChain
Programming
Computer Science
6 Days Ago
by usmanmalik57
… your prompt with the LLM. You can use the pipe
operator
(`|`) to create a chain. Finally, you can execute the message…
Re: operator()
Programming
Software Development
17 Years Ago
by Rashakil Fol
…string greeting_text; int
operator
()(const std::string& greetee) { std::cout &
lt
;&
lt
; greeting_text &
lt
;&
lt
; ", " &
lt
;&
lt
; greetee &
lt
;&
lt
; "!" &
lt
;&
lt
; std::endl;… world!" std::cout &
lt
;&
lt
; x &
lt
;&
lt
; std::endl; // outputs 12345 [/code] Generally speaking,
operator
() tries to provide the ability …
Re: += operator - Cannot get this to return correct value to application
Programming
Software Development
13 Years Ago
by Banfa
… the object it is called on, unlike the binary additional
operator
operator
+ which does not alter the object it is called on… of x and y. You need to re-write your
operator
+= so that is does an in place calculation, that is…
Re: Operator Overloading issue
Programming
Software Development
14 Years Ago
by Banfa
operator
+ is not in any way dependent on having any sort … this form (for a general type T) [code] T T::
operator
+(const T& rhs) { return T(*this) += rhs; } [/code] Which… having a copy constructor and an
operator
+=. However you do not have to implement your
operator
+ like this you can just implement…
Re: Create a new operator for class
Programming
Software Development
11 Years Ago
by Nutster
Operator
overloading is a mechanism where you can allow existing operators …
Polynomial operator class overloading
Programming
3 Years Ago
by msaadmakhdoom
Operator
Overloading for Polynomial Class - Your goal is to overload the …
Re: Overloading assignment operator
Programming
Software Development
18 Years Ago
by Narue
… code. Consider this: [code] struct C { // Default
operator
= (shallow copy) char *p; }; void foo ( C… C scratch; // Work with scratch c = scratch; } void
operator
= ( C& lhs, const C& rhs ) { …test ); } [/code] foo doesn't know that
operator
= was redefined because function declarations are positional. If you…
Re: Unary operator overloading : What's the use of int argument in postfix form
Programming
Software Development
13 Years Ago
by Narue
operator
+ is still a binary
operator
, whether you use the other operand or not. You could overload the unary
operator
+, but it's a prefix
operator
.
Re: Scope Resolution Operator
Programming
Software Development
18 Years Ago
by SpS
operator
:: known as scope resolution
operator
has been introduced to access an item that is outside the current scope. This
operator
is also used in distiguishing class members and defining class methods.
Re: [question] Operator overload
Programming
Software Development
9 Years Ago
by jwenting
operator
overloading isn't bad in theory, but it has such … with side effects, operators doing utterly illogical things (think Strawberry
operator
+(Apple a, Orange b)), the list goes on and on…
Re: [question] Operator overload
Programming
Software Development
9 Years Ago
by Rashakil Fol
Operator
overloading isn't bad. The worst case scenario is that … to mention assignment. That you even stop to gasp about
operator
overloading as if it had any real negative impact on…
Re: Code % Modulus operator
Programming
Software Development
13 Years Ago
by hugoguan
%
operator
is use to divide number, but it output the remainder of the number .exp:4%3=1. 5%3=2.
Re: [question] Operator overload
Programming
Software Development
9 Years Ago
by jwenting
operator
overloading is not just dangerous in the hands of inexperienced programmers. In fact in my experience it's most dangerous in the hands of experienced programmers who're overconfident and too clever for their own good, and as a result end up butchering it (and other language features) with "smart" things.
Re: new and delete operator
Programming
Software Development
14 Years Ago
by mrnutty
operator
new returns a void*, in which it is converted implicitly to whatever type you are using with assignment
operator
.
operator
delete does not return anything.
overloading
Programming
Software Development
12 Years Ago
by Alokkumar11
operator
overloading overloading unary operators
Re: Beginner's Tutorial on Operators
Programming
Software Development
10 Years Ago
by Learner010
`/`
operator
divide numerator by denominator. 4/2=2 5/2=2 (…
Re: must take exactly one argument
Programming
Software Development
18 Years Ago
by Bench
operator
&
lt
;&
lt
;() is a member function - you can only pass one parameter at a time to your Stack object using
operator
&
lt
;&
lt
;() - eg, [CODE]Stack… myStackObj; myStackObj &
lt
;&
lt
; SomeValueHere;[/CODE] If you are merely trying to overload
operator
&
lt
;&
lt
;() then it should…
Re: help (overload << in a template class )
Programming
Software Development
18 Years Ago
by Dogtree
operator
&
lt
;&
lt
; doesn't need to be a friend since … {data_[i] = value;}
operator
T*() {return data_;} }; template &
lt
;typename T, int SIZE> ostream&
operator
&
lt
;&
lt
;(ostream& out, const array…&
lt
;T, SIZE>& ar) { out&
lt
;&
lt
;"&
lt
; "; for(int…
Re: overloading increment/decrement operators
Programming
Software Development
18 Years Ago
by Stoned_coder
operator
++ and -- with no arguments return a reference to an object and not an object itself. bman you should have known better.
Re: Adding Two Polynomials
Programming
Software Development
12 Years Ago
by mzimmers
Operator
overloadings are often tricky. You'd do an addition
operator
like this: [CODE]Poly Poly::
operator
+(const Poly &rhs) { Poly temp; temp.size = size + rhs.size; return temp; } [/CODE] Note that this isn't going to solve all your problems in this program.
Re: OOP question
Programming
Software Development
14 Years Ago
by necrolin
…use an object. For example, you can overload the
operator
&
lt
;&
lt
; so that you can print the value associated with …an object rather than using an accessor function.
Operator
overloading also allows you to assign one object to …another via the
operator
=. This ensures that everything is copied correctly from …
Re: error in c#
Programming
Software Development
14 Years Ago
by ddanbe
Operator
overloads sure have their use. I don't see why you want to overload the C# ++
operator
! It is there for your use! So use it as such, don't get fancy because you like to do it. An index can easely be incremented with ++. Einstein once said: keep it simple, not simpler.
Re: error in c#
Programming
Software Development
14 Years Ago
by serkan sendur
Operator
overloading is the least useful thing in C#, the operators are not any different than method calls, it is just good for mathematic obsessive people who like to use smybols rather than words to feel special as they are not valued when they go to techno bar to catch some chicks.
Re: Help with Classes
Programming
Software Development
13 Years Ago
by mrnutty
>>
operator
+ (const money rhs) const I guess no one else saw this, but you need to specify the return type for any function. What should the return type of
operator
+ should be, in other words, what should the addition operation return for this class?
Re: overloading
Programming
Software Development
13 Years Ago
by Fbody
Operator
overloading is much like function overloading. However, it is not possible to give specific advice as your post is rather cryptic.
Re: Please help with Java mortgage calculator
Programming
Software Development
11 Years Ago
by NormR1
>
operator
> cannot be applied to double[],int You can not compare an array to an int value. Did you mean to have an index (in []s) with the array name to select an element from the array? The same problem with the other error. You can not use ++ with an array. You must select an element by using the [] notation.
Re: read tab delimited file into 2D vector
Programming
Software Development
12 Years Ago
by Narue
operator
&
lt
;&
lt
; is for output streams,
operator
>> is for input streams.
Re: Math tutor
Programming
Software Development
16 Years Ago
by Narue
>%
operator
removes randomness quite a bit. A problem which is statistically …
Re: efficient array update
Programming
Software Development
15 Years Ago
by kbshibukumar
[]
operator
is the best to add values to an array, I think. Applicable only if you know the index in advance. If you have to search in runtime for the position to which we can add a value, it will have a complexity of O(n). In that situation, if possible, use stl map.
Re: what is produced in an inflie function?
Programming
Software Development
14 Years Ago
by Tom Gunn
operator
>> is overloaded and will pick the right function for the type you want if there is an overload of that type. You can change int to float or double and the code will still work.
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC