While I cannot be certain, it is likely due to a lack of scoping on the string declaration. The C++ standard string class resides in the std namespace, and you would need to scope the declaration accordingly:
Alternately, if you expect to have a large number of string objects, you could bring the string class into scope throughout the file:
It is not recommended that you scope the entire namespace with using namespace std;, as this can lead to namespace conflicts. While the namespace-level scoping can be a convenience for small programs, it quickly becomes problematic, so it is best to avoid it unless you are certain it will not cause conflicts, and using in general should never be used in a header file, as it will cascade into any file that the header is included in.
Since you are using C++/CLI, rather than standard C++, you should also be aware that .Net Framework has its own String class, which is not compatible with the C++ standard string class. Most .Net functions expect a String, and won't work with a string.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.