Yeah ! Thanks !
Stephane Capo
Posts
-
Article section -
Article sectionHello, this Tip/Trick article I wrote : An Efficient String to Unsigned int ID Struct[^] was put in the Web Development/HTML section
, but it should be in something like General Programming/optimization or Programming Langage/C++. I tried to change tags without effect. Any suggestion ? thanks
-
Problem with pointers memory allocation on the same memory areaHello, I'm not sure to understand how the "serialization" works in your exemple. What is ar ?
ar >> m_pFont
m_pFont is a pointer, so in my opinion, there is no allocation here, only a pointer (ar) affected to another pointer (m_pFont). You probably have one instance of your font ( managed by your code or the library, I don't know ) referenced ( pointed ) by several m_pFont.
-
Cross Platform development for Windows and AndroidHello, if your objective is to share only the math component, then you probably can create a C++ DLL ( for the Windows side ) and .SO ( for the Android side ) and interface your existing C# and Java code (JNI) with this DLL. So only the math component needs to be ported (to C++). If you really want to port everything (both apps) to the same language, then C# (Xamarin) is probably a good choice. I also propose a free open source C++ cross-platform framework ( https://Kigs-framework.org ).
Stéphane Capo
-
asign to return valueYes.
-
asign to return valueSo you probably need to return a reference :
ChartNode& NodeCoord(int x, int z)
{
return Chart[z * 10 + x];
}else the
NodeCoord(4,4).access = false
will assign a temporary copy of your ChartNode struct and not the one in your array. -
asign to return valueHello, the code itself will work, but will not do what I suppose you expect. Here, Funct returns a copy of the TestStruct S. So Funct().x = 100 will affect 100 in a temporary TestStruct that you can not use after that. I don't know why you want to use a function to access your S structure, but the behavior you look for is probably :
// Funct returns a reference on S structure.
TestStruct& Funct()
{
return S;
} -
implicitly deleted because a base class invokes a deleted or inaccessible function 'CDialog::CDialog(const CDialog &)'Hello, I suppose that this should be better : SiBatchJobUpdateDlg updateDlg(this);
-
To bool or not to bool in C/C++ ?Hello, perhaps there's a confusion with older versions of C language where bool was not a standard type. But in all cases : "when "condition" such as in "if(condition)" evaluates to true, it is binary zero" is false ! cppreference.com[^] : If the source type is bool, the value false is converted to zero and the value true is converted to the value one of the destination type (note that if the destination type is int, this is an integer promotion, not an integer conversion).
-
Use of string class in c++I agree with other messages, we can not guess everything. My best guess is that you are compiling a C file? (not C++)...
-
Use of string class in c++Hello, some more details would be helpful! Do you mean std::string ? If this is the case did you include ? :
#include
then use std::string :
std::string astring("a string");