Asdew
What is file?
Andrea
FILE *file = fopen("file.txt", "r");
Asdew
You can't get the size of a file that way... What you did gets the size of a pointer, which is 8 bytes on your CPU.
Emir
Serhii
and your type is FILE*
Andrea
ok I understand .. thanks
Marián
Naman
/notes
Marián
you do this
1) create 'a' on stack
2) create 'a_ptr' on stack
3) create 'b' on stack
4) create 'c' on stack
5) change value at address of 'a_ptr'
how is the 5th step done on lower level? does it simply 'shift' the stack pointer back by '-3' and change the value of 'a'?
Dima
/warn ot
Anonymous
Bois
Anonymous
I need to make a function whose input* is an array of tuples which in which the first element is an array and the second an integer
Anonymous
something like this
[([1,2,3,4] ; 4) , ([5,6,7] ;5) ...]
Anonymous
how do I type the function is the questions sry if it's too dumb I already tried to google it
Anonymous
Thought about something like this :
vector< pair< vector<int>,int> >
Anonymous
I was told yo use the pair type
Anonymous
You can also use
std::array<std::pair<std::array<int, size1>, int>, size2>
if you know the size of the two arrays already.
An alternative would be to create a struct that holds an array and an integer and create an array of those objects
Anonymous
In a pair you can retrieve the elements with pair_name.first and pair_name.second, and that is a bit anonymous. Using a struct would allow you to call the variables with appropriate names.
struct Your_Pair
{
std::array<int, size1> variable1;
int variable2{0};
};
void function(std::array<Your_Pair, size2> &input) {}
Sir, Earl
/notes
PiRa
/get cppbookguide
Chirag
/notes
Chirag
/get
Chirag
/get freeprogrammingbooks
Naman
/get findprojects
Naman
/get noendl
itsmanjeet
how can i print a new line with linux system call "write"
not with printf or putc ...
Anonymous
Honestly GCC is the exception to a lot of bs
Anonymous
No
itsmanjeet
i didn't find that particular thing their
i am also not good at reading documentation 😅
Anonymous
It's just that I don't even remember how many years ago I even used GCC to do something wasn't aware of it
Anonymous
Nope does llvm ir
Anonymous
Any proofs?
Anonymous
LLVM IR is converted to assembly-like language at a backend part
Not necessarily the target assembly itself
Anonymous
> assembly printer
Anonymous
Not a LLVM IR to target assembly compiler
Mar!o
True
Anonymous
Hey any cs engineer here?
Mar!o
C#? yup
Mar!o
oh :(
Wakanda
Hello all
Piest
Hi admin, I am sorry for that. It is not an advertisement, it is C code for CAN protocol. And tutorial.
I would like to request you to remove this warning for me. And next time onwards before share I will get the permission from u. 👏👏👏👏👏👏👏👏👏
Dima
Nah
Anonymous
My fellow released an interesting C library
@const_cast, I think you'll like it
https://github.com/Hirrolot/poica
Dima
Anonymous
Dima
Indeed
...
How to take 100 digits input in c language ?
Please help me guys
Artöm
gmp library
Chirag
How many times can we use gets() function in whole program
Artöm
Lol
Chirag
Are you kidding me
Chirag
How it may be possible
Artöm
Chirag
And I am using it
Chirag
Not complete string
Artöm
It does not
Artöm
It can read a string or a line too
Chirag
Chirag
Thank
Vishal
http://www.vishalchovatiya.com/c-template-a-quick-uptodate-look/
Brief on C++ Template: Types, Category, Arguments, Specialization(full, partial, non-type, nested), New rules/liberation added from C++11/14/17/20 & Use-cases.
Anonymous
http://www.vishalchovatiya.com/c-template-a-quick-uptodate-look/
Brief on C++ Template: Types, Category, Arguments, Specialization(full, partial, non-type, nested), New rules/liberation added from C++11/14/17/20 & Use-cases.
Mα∂ɦµ, @das_3sz3tt, @h4cktill, can you review it?
Anonymous
Thanks
Anonymous
https://github.com/chandradeepdey/single_view/
smol library i made. adds an extra template nontype parameter N to ranges::single that allows iterating over a single element N times. compatible with C++11 (and up i hope)
code review?
Anonymous
Anonymous
Anonymous
each public should be followed by a comment explaining the category
Anonymous
So
notstd::single_view can be creates a new object, but what if I want to create it from already existing object? Only copy?
Anonymous
But what if it's not copyable?
Anonymous
If it's not movable?
Nils
Why does
std::srand(std::time(nullptr));
result in
Warnung: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsigned int'
?
Nils
ahhh nvm
Nils
I forgot a cast
Anonymous
klimi