Note that there are some explanatory texts on larger screens.

plurals
  1. POVisualC++ function problems (and other)
    primarykey
    data
    text
    <p>I have programmed in C++ a while, and I thought It would be fun to try to start with Visual C++ and make a calculator.</p> <p>Okay, so I have designed at simple window, with two Textboxes, and one button that Adds the two boxes together. I do know that I dont need a function for this, but I like to try things out, to learn them. So when Im in the design view, I doubleclick on the button, to get to its code. In the start of the code, I made two variables, and assigned a value to them. Now I would like to call a function that takes two parameters and returns the added value. Thats where it gets annoying, because I get this error:</p> <pre><code> error C3861: 'addFunction': identifier not found </code></pre> <p>I also have another problem. I have an if() to make sure that both textboxes have a value. The if is like this:</p> <pre><code>if(a &amp;&amp; b) </code></pre> <p>The compiler gives me this error:</p> <pre><code>error C2676: binary '&amp;&amp;' : 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator </code></pre> <p>Yeah, one of the variables is a string, but it should still work, right?</p> <p>I HOpe you can help me!</p> <p><strong>EDIT</strong> I have solved these two problems, but now, some more occured.</p> <p>The one error is complaining about this:</p> <pre><code>textstring = DecryptedBox-&gt;Text; </code></pre> <p>And there is another error, occuring in the compiler log like 10 times</p> <pre><code>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring(707): could be 'std::basic_string&lt;_Elem,_Traits,_Ax&gt; &amp;std::basic_string&lt;_Elem,_Traits,_Ax&gt;::operator =(std::basic_string&lt;_Elem,_Traits,_Ax&gt; &amp;&amp;)' 1&gt; with 1&gt; [ 1&gt; _Elem=char, 1&gt; _Traits=std::char_traits&lt;char&gt;, 1&gt; _Ax=std::allocator&lt;char&gt; 1&gt; ] </code></pre> <p>What does it mean?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload