Anonymous
Google how to work with string in C Basically, <string.h> header does this
Augmented
Yep
That's wonderfull, thank you very much for pointing me that out, i was struggling, because static const members can't be initialised in constructors, or if is not static, it will be included in all instances, which is waste of memory...
Anonymous
No
is it comparing memory addresses?
Anonymous
that the part i am a bit confused about
Augmented
What C++ standrard do you compile with?
I was bound to C+11 for few years, but now I went with C++17
Anonymous
I was bound to C+11 for few years, but now I went with C++17
That's wonderful to hear Then you can change const to constexpr there
Anonymous
Yes
so basically since t starts off pointing to the last character in the string , its memory address is further down the line the s would be , so its memory address is greater , and as t moves down the each character its memory address it points to get closer to s
Anonymous
Code looks ok. what is the problem?
Anonymous
Code looks ok. what is the problem?
i just wanted to have a full understanding on what was going on , but comparing memory addresses makes sense now
Augmented
That's wonderful to hear Then you can change const to constexpr there
Can constexpr reside inside the class definition, like encapsulated, so that constant will be like local within the class members, but also can be referenced externally as regular class member?
Anonymous
I cannot find the complexity of sqrtl in cppreference? Is there any other link?
Anonymous
Anonymous
Anonymous
Why do you need that?
Anonymous
Why do you need that?
so, as to know the extent to which it can hamper the actual time of execution.
Anonymous
Pointers to char, you mean
exactly , its all makes sense now
Anonymous
I just tested it, it's possible, thank you again
No problem Ask questions here more often 😉
Anonymous
Actually this operation is correct but useless
In the context it is ok, isn't it?
Anonymous
Actually this operation is correct but useless
i think the book just put it in there for the sake of better understanding pointer arithmetic
Anonymous
i am just reviewing the first 6 chapters before i finish the second half of the book
Anonymous
next chapter is on data structures and dynamic memory
Anonymous
char *juices[] = {"dragonfruit", "waterberry", "sharonfruit", "uglifruit", "rumberry", "kiwifruit", "mulberry", "strawberry", "blueberry", "blackberry", "starfruit"};
Anonymous
when declaring a pointer like this , what is the point , oppose to just declaring a juice character array ?
Anonymous
The array must be const
https://t.me/programminginc/224450
Anonymous
i seen arrays declared normally like char somearray[] = {some data}; but i also seen it declared as a point like char *somearray[] = {some data}
olli
i seen arrays declared normally like char somearray[] = {some data}; but i also seen it declared as a point like char *somearray[] = {some data}
char foo[] (array of chars - e.g. single string) char * foo (pointer to char - e.g. single string) char * foo[] (array of pointer to char - e.g. multiple strings)
Anonymous
Anonymous
So explain the question
read what he wrote ...
olli
thanks , do you mean single char for char * foo
char * is a pointer to a char, it can be a single char or it can be multiple ones - you can't tell from the type
Anonymous
char * is a pointer to a char, it can be a single char or it can be multiple ones - you can't tell from the type
one more question when would you use an array of pointers instead of a standard array
Anonymous
olli
one more question when would you use an array of pointers instead of a standard array
Array of pointers if the elements in the array are not of the same size, or the objects already exist in non contiguous memory regions
I_Interface
What do you mean
Array of pointers???
Anonymous
2-dimesional array is array of arrays
Anonymous
2-dimesional array is array of arrays
technically my example is a 2-dimensional array since its an array of strings , which a string is an array of characters ?
I_Interface
2-dimesional array is array of arrays
And the name of array - the pointer of it's 1st element l. :)
Anonymous
const char *juices[] = {"dragonfruit", "waterberry", "sharonfruit", "uglifruit", "rumberry", "kiwifruit", "mulberry", "strawberry", "blueberry", "blackberry", "starfruit”}; @I_Interface
Anonymous
Anonymous
i fixed it
Anonymous
if anybody wants to give it a go ,
Dima
isn’t it ‘heey look here’s some task, can you solve it?’
Anonymous
hello, i want to ask about how to know the standard supported by gcc-c++ on my mini linux computer?
olli
hello, i want to ask about how to know the standard supported by gcc-c++ on my mini linux computer?
run g++ --version to see which gcc version is installed, you can see here which feature is supported by which compiler https://en.cppreference.com/w/cpp/compiler_support
Ilya
when declaring a pointer like this , what is the point , oppose to just declaring a juice character array ?
This is not a pointer, this is array of pointers. And it must be const char *juices[] = {"dragonfruit", "waterberry", "sharonfruit", "uglifruit", "rumberry", "kiwifruit", "mulberry", "strawberry", "blueberry", "blackberry", "starfruit"};
Ilya
hello, i want to ask about how to know the standard supported by gcc-c++ on my mini linux computer?
Just check GCC version (gcc --version) and look for it in the compatibility table you can find on CPR site (cppreference.com)
Ilya
Ah olli already has sent it!
Anonymous
thank you
Anonymous
hello guys does any body have mysql download link?
Anonymous
Hi
Anonymous
Anyone help me
Anonymous
I have some confusion
rex
tell buddy
Pete
Can someone help me out with time complexity