M
Actually I read not to sell anything
M
Just introduced my self
klimi
Relax I m not selling anyone to anything
relax, i just said to read the rules
klimi
Just introduced my self
which just shows that you are ignorant about the rules, that's why i mentioned to read them, thank you
Muyi
sounds reasonable
Soprat//Котик
Please help me, how can I give an array as variable to some function? In C
klimi
Please help me, how can I give an array as variable to some function? In C
in C array is just a pointer to data, so just pass the pointer
Soprat//Котик
in C array is just a pointer to data, so just pass the pointer
but how can i go through it to get some element?
Soprat//Котик
Have you even tried googling?
yeah but i have readed it bad
PhD
but how can i go through it to get some element?
I suppose it's some kind of a school assignment, you'd actually need to learn some basics, but if it's urgent, try solving the problem with chatgpt. To iterate through an array use a for loop, but I don't think it's big of a help for you.
Danya🔥
yeah but i have readed it bad
https://www.geeksforgeeks.org/how-arrays-are-passed-to-functions-in-cc/
Soprat//Котик
thx for a lot
abdisa
but how can i go through it to get some element?
iterate over it until you get the delimiter or just pass the size as a parameter
JB
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
.
Hi, I don’t know much, so need a help. How can I write the html inputs value into a .txt file?
.
Like someone put abcd@gmailcom into a email input, what I do to it be written into a .txt file?
klimi
Like someone put abcd@gmailcom into a email input, what I do to it be written into a .txt file?
what do you mean by email input? if you are asking in c or c++ how to write to file, you ask operating system to do it for you or you use some library functions
Soprat//Котик
No I’m talking about html and JavaScript
So why do you here? In C/C++ chat
klimi
No I’m talking about html and JavaScript
No, you are not. This is C/C++ group so you must be talking about c/c++
Rose
No I’m talking about html and JavaScript
User DAC01N has 1/2 warnings; be careful! Reason: offtop
.
So why do you here? In C/C++ chat
My bad, thought it was more embracing, in the invite I got it says general questions, sorry again
klimi
Chill my bad
I'm chilled
.
Alright
John
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
Swiss
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
꧁☬κɪɴɢ☬꧂
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
꧁☬κɪɴɢ☬꧂
Hi I need a a program which contains Structur arry two class inheritance
VD
Hi I need a a program which contains Structur arry two class inheritance
struct S{}; class A{}; class B:public A{}; int array[10]; int main(){} There you go
H
How are chars compared in c? char to_upper(char c) { if (c >= 'a' && c <= 'z') c += 'A' - 'a'; return c; }
H
How can the char c be greater than 'a'?
H
Or are all chars converted to a number?
Кіт ✙
literally uint8_t
Danya🔥
literally uint8_t
Literally no
Кіт ✙
Literally no
correct me
Danya🔥
They can be signed or unsigned depending on a platform
H
Ok, thanks 👍
Кіт ✙
They can be signed or unsigned depending on a platform
they can also have as many bits as platform-defined (or compiler-defined? Char size isn't defined in standard), yup. But how to describe chars then?
Ludovic 'Archivist'
they can also have as many bits as platform-defined (or compiler-defined? Char size isn't defined in standard), yup. But how to describe chars then?
They are described using the type char, set to describe both exactly one byte of memory (byte as defined by a type of CHAR_BIT bits), which is an obscure type
Ludovic 'Archivist'
H
while (*str1 && *str2) { if (*str1++ != *str2++) return 0; } return (*str1 == *str2); }
H
What happens when you && two pointers??
Danya🔥
not 8, 7
No, 8 is the minimum
H
Or logically compare two pointers
Кіт ✙
CHAR_BIT ≥ 8
okay, at least 8. But at least means, that 64 bits would also be a standard-compliant char size
\Device\NUL
What happens when you && two pointers??
*(ptr + x) is basically ptr[x] and *ptr is same as ptr[0]
Danya🔥
not 8, 7
char must be able to hold UTF-8 code point or whatever the smallest thing in UTF-8. It requires 8 bits.
H
*(ptr + x) is basically ptr[x] and *ptr is same as ptr[0]
Oh, so the values in the pointers are compared, right?
Ludovic 'Archivist'
char must be able to hold UTF-8 code point or whatever the smallest thing in UTF-8. It requires 8 bits.
Be careful, because this bit of the standard is a bit broken, it requires that char be able to represent UTF-8 codepoints that are strictly lower than 128, which can be represented in 7 bits, char8_t is required to be considered a narrow type but it is not required to be the same as char
Кіт ✙
Yes It's the case for some DSP processors.
so is it platform-defined with a hint, that almost always 1 byte
\Device\NUL
char is guaranteed to hold ASCII char from what I learned
Ludovic 'Archivist'
char is guaranteed to hold ASCII char from what I learned
In C, the format is not mandated, in C++, de facto, ASCII is required (for versions of C++ after 11 if I am not mistaken)
Кіт ✙
I though 0 - 255
typo, sorry
Ludovic 'Archivist'
No http://eel.is/c++draft/intro.memory#1
Oh, that was added! It was not the case a few years ago Thanks for correcting me, that is a huge change in what I need to support now
Danya🔥
Oh, that was added! It was not the case a few years ago Thanks for correcting me, that is a huge change in what I need to support now
It was there in C++17 I'm currently looking into the final draft of C++17 and "eight-bit" is there
Ludovic 'Archivist'
I have to thank Jens Maurer and hand him a beer for that PR2314R4
Danya🔥
I didn't read the entire standard since C++14
I've never read it fully I'm not a psychopath, but this requirement was there for as long as I can remember. I think it should've been added in 11 or 14
Ludovic 'Archivist'
before there was a clause that was in the footnotes about only the 0-127 range of UTF-8 being supported