error: cannot convert 'std::string' to 'std::string*' in assignment??

This is a discussion on error: cannot convert 'std::string' to 'std::string*' in assignment?? within the C++ Programming forums, part of the General Programming Boards category; Is anyone else reminded of the insane and crappy code Sebastiani posted to "bend the rules" to allow a "null ...

  1. #31
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,334
    Is anyone else reminded of the insane and crappy code Sebastiani posted to "bend the rules" to allow a "null reference" and the resulting arguments?

    Soma

  2. #32
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by phantomotap View Post
    Is anyone else reminded of the insane and crappy code Sebastiani posted to "bend the rules" to allow a "null reference" and the resulting arguments?

    Soma
    Are you kidding? That was a gem! It doesn't hurt to think outside of the box, you know...
    Last edited by Sebastiani; 06-02-2010 at 04:27 PM. Reason: mean-spirited remarks removed
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #33
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,334
    Like I said then, if you are going to break the rules, break the $*&# out of them. If you are going to pretend to reassign a reference, why not go all the way?

    [Edit]
    I read your post pre-edit. You didn't need to change it. I assumed you were poking at me much the same as I was poking at you.
    [/Edit]

    [Edit]
    AND WHY DOES CBOARD INSIST ON EATING MY EDITS!?
    [/Edit]

    Soma
    Last edited by phantomotap; 06-02-2010 at 04:37 PM. Reason: none of your business

  4. #34
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by phantomotap View Post
    Like I said then, if you are going to break the rules, break the $*&# out of them. If you are going to pretend to reassign a reference, why not go all the way?

    Soma
    FYI, using a tool in an unorthodox way does not equate to using it incorrectly.

    Anyway, I'm not suprised by your response, really. You were, after all, the one who so brilliantly suggested that we allow the MiniBasic virtual machine to segfault on a malformed program! Apparently, designing robust software is much less important to you than writing "orthodox" code. How droll.
    Last edited by Sebastiani; 06-02-2010 at 05:05 PM. Reason: seething insults removed - just kidding, minor rewording
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #35
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,334
    FYI, using a tool in an unorthodox way does not equate to using it incorrectly.
    LMAO!

    You are talking to a master jury rigger. I practically have a PhD in "unintended purposes". I also never implied you were doing anything incorrectly.

    You were, after all, the one who so brilliantly suggested that we allow the MiniBasic virtual machine to segfault on a malformed program!
    This I have a problem with. I never said anything of the sort. The compiler should catch a malformed program before the virtual machine has a chance to process it.

    I suggested that the virtual machine behave realistically. I said that if a programmer misused my imagining of the `PUSH'/`PEEK' implementation to trample over the instruction area they should face the consequences. I stand by this.

    Soma

  6. #36
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    You guys make my head hurt.

    I prefer using references when it comes to std::string. In fact if I ever see std::string * it usually throws up a red flag in my book. That is not to say it isn't valid it is just something I'm not all that used to seeing.

  7. #37
    ...and never returned. StainedBlue's Avatar
    Join Date
    Aug 2009
    Posts
    168
    Quote Originally Posted by Bubba View Post
    You guys make my head hurt.

    I prefer using references when it comes to std::string. In fact if I ever see std::string * it usually throws up a red flag in my book. That is not to say it isn't valid it is just something I'm not all that used to seeing.
    If Programmer_P get his way, that will surely change!

    all in good fun
    goto( comeFrom() );

  8. #38
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,782
    Quote Originally Posted by Sebastiani View Post
    Gawd, I love it when you're wrong, Elysia - you'll go to almost any length to avoid admitting it!
    Who was right, and who was wrong? Eh? Eh???!
    On a side note, it is always interesting when you try to break the language. I love it. But you shouldn't go about calling it or naming it to something that it isn't. Pedantic views are always the best. I think.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #39
    Programming Ninja In-T...
    Join Date
    May 2009
    Posts
    827

    Talking

    Quote Originally Posted by StainedBlue View Post
    If Programmer_P get his way, that will surely change!

    all in good fun
    You guys crack me up...
    I couldn't stop laughing after reading some of the posts in this thread.

  10. #40
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by Elysia View Post
    Who was right, and who was wrong? Eh? Eh???!
    Oh, fine! You were right, Elysia.

    <villainous voice>: "I would have gotten away with it, too, if it weren't for you meddling pedanticists!!!"
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  11. #41
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,782
    Quote Originally Posted by Sebastiani View Post
    <villainous voice>: "I would have gotten away with it, too, if it weren't for you meddling pedanticists!!!"
    Ah, but you should know by now that this board is full of us pedanticists who specializes in knowing the ins and outs of the language, down to the very definitions in the standardese text!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu
    By Krush in forum C Programming
    Replies: 17
    Last Post: 09-01-2009, 02:34 AM
  2. Convert uint16_t to std::string?
    By magicalo in forum C++ Programming
    Replies: 3
    Last Post: 07-18-2008, 01:34 AM
  3. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  4. What is the easies way to convert int to std::string?
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 12-04-2007, 01:15 AM
  5. Replies: 1
    Last Post: 10-27-2006, 01:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21