What is uintptr_t data type

uintptr_t is an unsigned integer type that is capable of storing a data pointer. Which typically means that it’s the same size as a pointer. It is optionally defined in C++11 and later standards. A common reason to want an integer type that can hold an architecture’s pointer type is to perform integer-specific operations on a … Read more

Check if a string is palindrome

Just compare the string with itself reversed: This constructor of string takes a beginning and ending iterator and creates the string from the characters between those two iterators. Since rbegin() is the end of the string and incrementing it goes backwards through the string, the string we create will have the characters of input added to it in reverse, reversing the … Read more

Graphics Library for C++

Having learned the basics of OpenGL in a 10 week university course that was primarily focused on modeling statistical data, I would definitely think OpenGL would be a reasonable option for an easy to learn graphics package for 2D real time modeling. Although there’s certainly complexity available to OpenGL you don’t need to wrap your … Read more

What is use of c_str function In c++

c_str returns a const char* that points to a null-terminated string (i.e. a C-style string). It is useful when you want to pass the “contents”¹ of an std::string to a function that expects to work with a C-style string. For example, consider this code: See it in action. Notes: ¹ This is not entirely true because an std::string (unlike a C string) … Read more

Pass a vector by reference C++

Firstly you need to learn the differences between references and pointers and then the difference between pass-by-reference and pass-by-pointer. A function prototype of the form: expects a function call of the type: Whereas, a prototype of the form: expects a function call of the type: Using the same logic, if you wish to pass the vector by reference, … Read more

(->) arrow operator and (.) dot operator , class pointer

you should read about difference between pointers and reference that might help you understand your problem. In short, the difference is:when you declare myclass *p it’s a pointer and you can access it’s members with ->, because p points to memory location. But as soon as you call p=new myclass[10]; p starts to point to array and when you call p[n] you get a reference, which members … Read more

invalid conversion from ‘const char*’ to ‘char*’

Well, data.str().c_str() yields a char const* but your function Printfunc() wants to have char*s. Based on the name, it doesn’t change the arguments but merely prints them and/or uses them to name a file, in which case you should probably fix your declaration to be The alternative might be to turn the char const* into a char* but fixing the declaration is preferable:

error: lvalue required as unary & operand

The address-operator & requires a variable to take the address from. The result of your cast (long)u32_Time is a temporary that does not necessarily reside in memory and therefore has no address that could be taken. So if that piece of code ever compiled somewhere it was a nonstandard compiler extension. The standard, §5.3.1,3 demands: The result of the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)