Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku
My account: Login | Sign Up
Loading... 

invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' | Thread profile

Thread profile page for "invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'" on http://www.codeguru.com. This report page is a snippet summary view from a single thread "invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'", located on the Message Board at http://www.codeguru.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity, which are reported in a table below. Additional thread profile information is also shown in the following ways:

1) Top Contributing Authors
2) Related Threads on "eBay Auctions"
3) Related Threads on Other Sites

Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a thread's popularity and/or exact posting volumes at any given reporting period.

Title: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'
Site: CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions  CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions - site profile
Forum: C++ (Non Visual C++ Issues)  C++ (Non Visual C++ Issues) - forum profile
Total authors: 3 authors
Total thread posts: 6 posts
Thread activity: no new posts during last week
Domain info for: codeguru.com

Thread posts in invalid operands of types 'const char[13]' and 'char*' to binary 'operator+':

1. 
Started 9 months, 3 weeks ago (2008-09-12 01:41:00)  by SimbaSpirit
I don't understand where the const char is coming from. As mentioned in the title, the error I'm getting is " invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'". Am I using strcat incorrectly? (BTW I'm barely starting to learn C++, so I'm sure it's not as well written as it could be... just trying to understand the fundamentals) Code: #include <...
Size: 3,220 bytes
Customize:  Customize "invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
2. 
Started 9 months, 3 weeks ago (2008-09-12 02:02:00)  by Paul McKenzie
Quote: Originally Posted by SimbaSpirit I don't understand where the const char is coming from. As mentioned in the title, the error I'm getting is " invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'". Code: strchr("Less than a " + chUnitSingular);} What are you intending to do with ...
Size: 1,655 bytes
Customize:  Customize "<b>Reply 1</b>: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
3. 
Started 9 months, 3 weeks ago (2008-09-12 02:19:00)  by SimbaSpirit
Eh, I saw it in a forum... what should I put in its place? I tried using string = ("text" + string) and I got a similar error.
Size: 157 bytes
Customize:  Customize "<b>Reply 2</b>: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
4. 
Started 9 months, 3 weeks ago (2008-09-12 03:53:00)  by compavalanche
if you use std::string then you can use the + operator to concatenate strings. If you use char* or char[] you cannot. I recommend you start small and read up on std::string. Here is a simple example to get you started Code: #include <string> #include <iostream> int main() { std::string foo("hello"); std::string bar("world"); std::cout << foo << " " << bar << ...
Size: 1,062 bytes
Customize:  Customize "<b>Reply 3</b>: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
5. 
Started 9 months, 3 weeks ago (2008-09-12 04:26:00)  by Paul McKenzie
Quote: Originally Posted by SimbaSpirit Eh, I saw it in a forum... Forums and websites are not the proper way to learn C++, as many of them are full of mistakes, errors, bad coding habits, etc. You need to read good books on C++ to get properly grounded in the language. For example, you included <string>, and that is not the ...
Size: 1,500 bytes
Customize:  Customize "<b>Reply 4</b>: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
6. 
Started 9 months, 3 weeks ago (2008-09-12 05:03:00)  by SimbaSpirit
Quote: So you've got everything backwards. I wouldn't say I have everything backwards so much as I used the wrong command lol Anyways... thanks for the help
Size: 493 bytes
Customize:  Customize "<b>Reply 5</b>: invalid operands of types 'const char[13]' and 'char*' to binary 'operator+' :: C++ (Non Visual C++ Issues) :: CodeGuru Forums - A Developer.com Community for C+..."
 

Top contributing authors for invalid operands of types 'const char[13]' and 'char*' to binary 'operator+'

Name
Posts
SimbaSpirit
3
user's latest post:
invalid operands of types...
Published (2008-09-12 05:03:00)
Quote: So you've got everything backwards. I wouldn't say I have everything backwards so much as I used the wrong command lol Anyways... thanks for the help
Paul McKenzie
2
user's latest post:
invalid operands of types...
Published (2008-09-12 04:26:00)
Quote: Originally Posted by SimbaSpirit Eh, I saw it in a forum... Forums and websites are not the proper way to learn C++, as many of them are full of mistakes, errors, bad coding habits, etc. You need to read good books on C++ to get properly grounded in the language. For example, you included &lt;string&gt;, and that is not the correct header. The correct header is &lt;cstring&gt; for C-style strings, not...
compavalanche
1
user's latest post:
invalid operands of types...
Published (2008-09-12 03:53:00)
if you use std::string then you can use the + operator to concatenate strings. If you use char* or char[] you cannot. I recommend you start small and read up on std::string. Here is a simple example to get you started Code: #include &lt;string&gt; #include &lt;iostream&gt; int main() { std::string foo(&quot;hello&quot;); std::string bar(&quot;world&quot;); std::cout &lt;&lt; foo &lt;&lt;...