/
std::ifstream rom( file_name, std::ios::binary | std::ios::ate );
if ( !rom.is_open() )
{
return -1;
}
rom >> memory[rom_mem_start_addr];
/
is it copying the full content of rom into the array?
/
and why is open returns no while the file exists
Map
What's is the importance of
std:: in c++?
Ludovic 'Archivist'
What's is the importance of
std:: in c++?
std is the namespace for the standard library. It is a pretty important part of C++ as it both exposes tools to be used with the language and actual features of the language that cannot be expressed without it
Map
/
help
fan
Владислав🇺🇦
It was a link to cppinsights................
Roxifλsz 🇱🇹
Yeah, bit of a false positive
Roxifλsz 🇱🇹
original message:
Hello. I bumped into a strange but rather useful behavior of templates that I cannot fully understand.
Here is the code: https://cppinsights.io/s/9a2ff470
Why does not compiler complain that EValues enum class is private within the template's context?
Владислав🇺🇦
Thank you
Anonymous
Владислав🇺🇦
Владислав🇺🇦
I mean, in the end we anyway have to create an optional of type EValues, but this type is private and the optional itself does not seem to be located in the scope pf the class
Владислав🇺🇦
Ludovic 'Archivist'
How can I google it to learn more?
https://en.cppreference.com/w/cpp/language/access
> The name of every class member (static, non-static, function, type, etc) has an associated "member access". When a name of the member is used anywhere a program, its access is checked, and if it does not satisfy the access rules, the program does not compile
Ludovic 'Archivist'
Notice how it says that *the name* has an associated access
Ludovic 'Archivist'
How can I google it to learn more?
I would recommend that when you have a question on some C++ concept you do a search with the site specifier on google, for example like so:
site:en.cppreference.com accessibility
Ludovic 'Archivist'
Like so, it only gives results on the site you search on, and cppreference generally has most of the answers about the standard
Koxy
Is C a high level language or low level
Dima
it really isnt hard to google lol
Gionny
Hello, is there anyone who has ever used milu? Is a software to do mutation testing in c
Gionny
I have a problem and I don't know how to fix it
Map
Michel
Hi, anyone with CUDA knowledge can help me here?
void
void
ASM is low level
Hermann
how delete last element in unorder_set? iterating all elements?
Dm
Have someone worked with stat() function to Get File Information?
<sys/stat.h> library.
I stuck and don't understand why I am getting almost the same modification time for each file on my PC?
ls -la returns different time stamps.
stat return time_t time and I convert it with ctime and print.
Daulet
Дон
How to dereference a some element of two dimensional array?
Daulet
Dm
Plz show code
https://pastebin.com/53ZJV0cF
line 100-103
only int ls function matter
Daulet
Dm
Why you not use ctime?
It's doesn't matter. The issue still exists if I change this to ctime
I just want my custom format (the same as in regular ls -la utility)
Daulet
Hizmu(Vlad)
Hizmu(Vlad)
https://pubs.opengroup.org/onlinepubs/009696799/functions/stat.html
Hizmu(Vlad)
maybe he read normally for the first time, and then returns you -1, but s does not overwrite
Daulet
Daulet
Daulet
Dm
you are genius
Daulet
Dm
I changed from this:
while ((dent = readdir(dir)) != NULL) {
if (l_flag) {
stat(dent->d_name, &s);
to this:
std::string tempPath = path;
while ((dent = readdir(dir)) != NULL) {
if (l_flag) {
tempPath = path + dent->d_name;
stat(tempPath.c_str(), &s);
and now it's works fine..
I don't know why i didn't understand this before by mw own. Anyway you helped me a lot. Thank you :)
Daulet
Dm
lol. i searched for answer some time. found too much stackoverflow. okay maybe my googling skill is really poor :)
Daulet
hygge
is there a Csharp group?
sushi
class container
{
public:
std::string Name;
int Quantity;
double Price;
int sum = 0;
int Total()
{
return Price * Quantity;
}
int TotalAmt(container** containers, int n)
{
int sum = 0;
for(int i=0; i<n; i++)
{
sum += containers[i]->Total();
std::cout<<TotalAmt<<"Total Amount:"<<std::endl;
}
return sum;
}
};
HOW AM I GONNA MAKE THE TOTAL AMT WORK IN ORDER TO OUTPUT THE SUM
Anonymous
What is
#define _GNU_SOURCE_
?
Ivan
clang --version
clang: symbol lookup error: /usr/lib/libclang-cpp.so.14: undefined symbol: _ZN4llvm9MDBuilder25createRTTIPointerPrologueEPNS_8ConstantES2_, version LLVM_14 Why this happens ?
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
What is
#define _GNU_SOURCE_
?
You get access to a lot of gnu extensions, functions etc. Also you'll have gnu tools from c code like mount, basename, ifconfig.
Anonymous
Rajeev
Is anyone online?
I'm facing with a compilation error. Please help me
klimi
Rajeev
I can't send photos here because I'm coding in pc
Rajeev
#include<bits/stdc++.h>
using namespace std;
template <typename T>
void print(T x){
for(auto i:x) cout<<i<<" ";
cout<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);
int arr[4] = {1 ,4, 5,3};
print(arr);
return 0;
}
Rajeev
error: begin was no declared in this scope...
klimi
klimi
because you are passing int * to the print function
klimi
but int * does not implement begin and end functions, so this is why the for cycle doesn't want to work
Dm
Map
Can Someone please basically help me with the understanding of
Double and
Float
I understand there all number with decimals point's.
But somehow difficult to get the knowledge
Rajeev
Dm
Hermann
what does means thi serror? https://godbolt.org/z/5YbnsfM8T
Daulet
VantaSoft
Hi can someone please convert this few lines of c++ code to c#?
https://github.com/mq1n/DLLThreadInjectionDetector/blob/master/DLLInjectionDetector/DLLCheck.cpp
fan
Hey! guys!
Can somebody help me to solve this problem?
https://stackoverflow.com/questions/73502557/how-to-forward-the-micro-args-to-format-func
Hermann