Anonymous
Rab all
BinaryByter
what?
Anonymous
Write a program to print the mark list of the students each record contain roll number ,name ,and total mark
Anonymous
First, we won't do any of your homeworks, second, that also doesn't make any sense
Parra
Cpp have some package manager? Like pip in python, yaourt in arch linux e.t.c
it has many, conan is one of them, but i prefer to use cmake externalProject to manage them
Anonymous
Not homework
Dima
this is your assignment
Dima
and it’s easy tho
Anonymous
No
Anonymous
No
Do it yourself and if you have questions, you can ask
BinaryByter
this group is NOT for people writing code for you
Anonymous
/warn no weird photos
Dima
Dima
what the hell
Dima
imagine reading that font in your ide
Anonymous
Gaurav
Vladyslav 🇺🇦🇪🇺
Folks, advice my please some awesome workshops or cookbooks for learn c++ on practice
Vladyslav 🇺🇦🇪🇺
Something like this
Vladyslav 🇺🇦🇪🇺
Omg
Vladyslav 🇺🇦🇪🇺
Some thing like using arduino
Vladyslav 🇺🇦🇪🇺
or something else interesting
Vladyslav 🇺🇦🇪🇺
Without unreal engine lol
Nicola
are there any functions to insert text from the keyboard to save it in a string variable?
MᏫᎻᎯᎷᎷᎬᎠ
Yeah
Nicola
Nicola
why this error
Anonymous
Bladee fuckerss🔥🍕
Anonymous
"I want a list, not a linked list, how to get that in C++?"
Sanji
Is there any android app were I can try c program
Anonymous
termux
Deniz
Can we install gcc on termux?
Anonymous
Yes
Nicola
[Error] request for member 'c_str' in 's.std::basic_string<_CharT, _Traits, _Alloc>::operator[]<char, std::char_traits<char>, std::allocator<char> >(((std::basic_string<char>::size_type)i))', which is of non-class type 'char'
Nicola
what does it mean
Nicola
string conStrBin(string s){ string s1; for(int i=0;i<s.size();i++){ s1+=bitset<8>(s[i].c_str()).to_string<char,string::traits_type,string::allocator_type>(); } return s1; }
Nicola
template?
Nicola
yes
Nicola
and i use to_string
Nicola
i solved ahahahha, string conStrBin(string s){ string s1; for (int i=0;i<s.size();i++) { s1+=bitset<8>(s[i]).to_string(); } return s1; }
Nicola
32/5000 should I use int or size_t?
Nicola
and i use namespace std
Nicola
OK thanks a lot
Nicola
is the stoi function contained in the <string.h> library?
Nicola
I saw from the link you shared that the other fields can omit them, but does not recognize that function. why?
Nicola
How should I do otherwise?
Ludovic 'Archivist'
Ludovic 'Archivist'
But meh
Ludovic 'Archivist'
You have to write the char* into the string in that case, but rather try to use a more up to date compiler and version of C++ if possible
Ludovic 'Archivist'
C++03 is 15yo
Ludovic 'Archivist'
And C++98 is old enough to buy its own beer
Nicola
on the left is the string containing the binary value and on the right the result of the atoi function, is there no way to get that same value?
Ludovic 'Archivist'
on the left is the string containing the binary value and on the right the result of the atoi function, is there no way to get that same value?
So you want to parse a string that represent a binary into that number if I understand correctly?
Nicola
Yes
Nicola
The string for example is "10010101" , my int variable must be 10010101
Ludovic 'Archivist'
The string for example is "10010101" , my int variable must be 10010101
http://www.cplusplus.com/reference/cstdlib/strtol/ string a = "10010101"; char* ingnored; uint64_t value = strtol(a.c_str(), &ignored, 2);
Nicola
I know but I want 1001010 , but my int is worth a decimal number, it certainty implies the decimal value
Ludovic 'Archivist'
You don't provide an actual value when you use it, just a pointer
Ludovic 'Archivist'
You don't provide an actual value when you use it, just a pointer
And well it is not used for memory safety within the function but as an out parameter
Ludovic 'Archivist'
But since one may want to compare it with a.c_str()+a.size()...
Ludovic 'Archivist'
I know
Ludovic 'Archivist'
The function will initialize it
Ludovic 'Archivist'
If it were me I'd do string a = "10010101"; char* consumed; uint64_t value = strtol(a.c_str(), &consumed, 2); if(consumed==a.size()+a.c_str()) { //The string have been entirely consumed }
Ludovic 'Archivist'
Because generally your string is not just solely a number
Ato
What is 911 vpn?
BinaryByter
off topic
BinaryByter
and more expensive than tor
V13
Ok
Ludovic 'Archivist'
Using C functions at all is unsafe
Dima
Using C functions at all is unsafe
just add the special ingredient called _s and you are good to go
Ludovic 'Archivist'
Which is why I also advise to update his standard
Dima
Ludovic 'Archivist'
just add the special ingredient called _s and you are good to go
Or just use C++ and a range based number parser like a sane person
Ludovic 'Archivist'
But in case of error you will at least be able to do stuff and will not crash over an absense of null terminator
Ludovic 'Archivist'
But in case of error you will at least be able to do stuff and will not crash over an absense of null terminator
And if you are just a little bit cunning you parse a string_view that limits the number of digits usable to the actual range the user will want
Anonymous
Hi guys, I'm new to C and to the channel. I have a question about fgets() reading from stdin.