Click here to Skip to main content
15,886,052 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString replace function Pin
ThatsAlok28-May-09 6:07
ThatsAlok28-May-09 6:07 
QuestionThe strange behaviour of the text. Pin
daavena27-May-09 10:50
daavena27-May-09 10:50 
AnswerRe: The strange behaviour of the text. Pin
Nibu babu thomas27-May-09 18:13
Nibu babu thomas27-May-09 18:13 
QuestionDll - MFC - Customised browser Pin
rosemaried27-May-09 6:26
rosemaried27-May-09 6:26 
AnswerRe: Dll - MFC - Customised browser Pin
«_Superman_»27-May-09 22:08
professional«_Superman_»27-May-09 22:08 
Questionsizeof related in c/c++ Pin
hawk23reddy27-May-09 4:39
hawk23reddy27-May-09 4:39 
AnswerRe: sizeof related in c/c++ Pin
Emilio Garavaglia27-May-09 4:50
Emilio Garavaglia27-May-09 4:50 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 5:10
professionalStuart Dootson27-May-09 5:10 
emilio_grv wrote:
well ... technically speaking ... every operator IS a function


In a language like Haskell, yes. In C or C++, not so much - for example, can you show me how to get the address of +, so I can use it as a functor in an STL algorithm?

To elaborate on the Haskell reference - any operator can be used where a function could be used by surrounding it in parentheses. Similarly, any function can be used as an operator by enclosing it in backticks.

For example:

-- Define an addition function
add x y = x + y

-- Define two functions that add integer lists. The first uses the + operator
-- as a function, the second uses add. They are equivalent.
addLists1 :: [Int] -> [Int] -> [Int]
addLists1 l1 l2 = zipWith (+) l1 l2

addLists2 :: [Int] -> [Int] -> [Int]
addLists2 l1 l2 = zipWith add l1 l2

-- The 4 lines of main are equivalent - they all add 3 and 4 with
-- different combination of operator/function and operator/function syntax.
main = do
          print (add 3 4)
          print ((+) 3 4)
          print (3 `add` 4)
          print (3 + 4)


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: sizeof related in c/c++ Pin
Emilio Garavaglia27-May-09 7:41
Emilio Garavaglia27-May-09 7:41 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 7:53
professionalStuart Dootson27-May-09 7:53 
AnswerRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 4:58
professionalStuart Dootson27-May-09 4:58 
AnswerRe: sizeof related in c/c++ Pin
David Crow27-May-09 5:00
David Crow27-May-09 5:00 
GeneralRe: sizeof related in c/c++ Pin
hawk23reddy27-May-09 5:23
hawk23reddy27-May-09 5:23 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 7:38
professionalStuart Dootson27-May-09 7:38 
AnswerRe: sizeof related in c/c++ Pin
«_Superman_»27-May-09 22:03
professional«_Superman_»27-May-09 22:03 
QuestionAccess to a view from a CTreeCtrl Pin
Gagnon Claude27-May-09 1:45
Gagnon Claude27-May-09 1:45 
QuestionCopy text in Memory DC. Pin
zakkas248327-May-09 0:08
zakkas248327-May-09 0:08 
AnswerRe: Copy text in Memory DC. Pin
CPallini27-May-09 0:23
mveCPallini27-May-09 0:23 
GeneralRe: Copy text in Memory DC. Pin
zakkas248327-May-09 0:37
zakkas248327-May-09 0:37 
GeneralRe: Copy text in Memory DC. Pin
CPallini27-May-09 0:57
mveCPallini27-May-09 0:57 
Questionhow to attach horizontal scroll bar to combo box control Pin
saksp26-May-09 23:57
saksp26-May-09 23:57 
AnswerRe: how to attach horizontal scroll bar to combo box control Pin
Nibu babu thomas27-May-09 1:18
Nibu babu thomas27-May-09 1:18 
QuestionVS2005 backward compatibility Pin
Sunil P V26-May-09 23:40
Sunil P V26-May-09 23:40 
QuestionHow to use Win32_Tpm class method? Pin
aishui090526-May-09 23:38
aishui090526-May-09 23:38 
QuestionHow to calculate string width and height in pixel. Pin
pandit8426-May-09 23:25
pandit8426-May-09 23:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.