MAC
Cause it's memcpy -> memcopy
I'm creating new Os , and you helped me
MAC
Cause it's memcpy -> memcopy
for example, as Linux or Windows
MAC
Cause it's memcpy -> memcopy
Can you help me with introduction ?
Ammar
Vlad
How can I build it ?
Implement memcpy?
Vlad
It's basically just a for loop
Ammar
The easiest and shortest way is using rep movsb.
Ammar
The best way use bzero
bzero isn't portable, memset should be better.
Vlad
The best way use bzero
bzero is not in the standard library
MAC
bzero isn't portable, memset should be better.
but some books recommend to use bzero other memset, which difference between them if except portable ?
Ammar
but some books recommend to use bzero other memset, which difference between them if except portable ?
What's the reason your book mentioned for using bzero over memset?
Ammar
lot of them belong to network books
Ah okay. I think I read the same thing when I was studying socket programming years ago. The example was always for zeroing struct sockaddr_in.
Anonymous
❤️❤️
Epiginosko
Hi everyone
Anonymous
Output
5 2 7 3
Vlad
Order of execution within the statement is not defined
Vlad
Each compiler can do whatever is the most convenient for their implementation
Anonymous
it is answered here - https://stackoverflow.com/questions/7356378/cout-vs-printf-order-of-execution
Cesco
Hello everybody :)
Cesco
i know it's a bit rude to join a group and immediately start asking for things, but i can't get over this problem .. I have to launch a file (for example chrome.exe) located in another directory. as long as the file is in the same directory there are no problems, I can use system ("chrome.exe"); I have tried in various ways, changing parameters and everything but I've never been able to launch any file . I also searched the internet but I don't have much experience so any help would be appreciated
Cesco
How do you specify the path to the file when it's in another directory?
i tried in many ways, like system("cd C:\\Program Files (x86)\\Google\\Chrome\\Application"); (without double backslash i had a lot of warnings) system("chrome.exe"); or, system("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
Ehsan
just type the new directory in the system call
you can also make a bash script if you are more comfortable with it
Cesco
just type the new directory in the system call
already tried, i had errors about c is not a program ecc ecc
Cesco
sorry but i've been writing in c ++ for less than a year in high school and i don't know how bash etc etc are used, after i'll look thanks to all anyway
Ehsan
system("cd C:\\Program Files (x86)\\Google\\Chrome\\Application; ./chrome.exe”); (without double backslash i had a lot of warnings)
Cesco
it should work 🙂
"C:\Program" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. // translated "C: \ Program" is not recognized as an internal or external command, an executable program or batch file.
⚛ Hz
(PS: You can use / as path separator in windows (works for all win32 api, not working for NT api
⚛ Hz
The problem is the space in the path, so you may need system("cd \"C:\\Program Files (x86)\\Google\\Chrome\\Application\"; ./chrome.exe");
⚛ Hz
or if you're using c++ try system(R"command(cd "C:\Program Files (x86)\Google\Chrome\Application"; chrome.exe)command");
⚛ Hz
ref: https://en.cppreference.com/w/cpp/language/string_literal
Cesco
ok no one worked. ig it's my pc problem, it has a lot of problem with windows :( thanks anyway
⚛ Hz
wait, removed ./ , it doesn't work with windows
⚛ Hz
btw, you should use another way to launch program
⚛ Hz
https://docs.microsoft.com/en-us/windows/win32/procthread/creating-processes <- the official way to create process
Pritam
I can't understand the file handling, please help me
Anonymous
I can't understand the file handling, please help me
What problem are you facing regarding this ?
Pritam
Totally
Anonymous
Totally
Focus on it completely! Start from scratch, you'll definitely learn to play with it.
Anonymous
Focus on it completely! Start from scratch, you'll definitely learn to play with it.
Check first, what are the requirements to use this concept in a program, after that point on I/O operations.
Pritam
What is the work of these operations's?
Anonymous
Suppose if I'll ask you to tell that which header file is used to start with File Handling ? What will be your answer ? If you've lil bit info about it.
Anonymous
What is the work of these operations's?
Just to read/write from/into any txt file and perform further actions.
Pritam
Ok
Anonymous
Ok
Yeah, Alright! ✌️ Not Panic! 😊 Just Chill! 🍁🖤
MAC
template <class T> T um(T &first, T &second) { T three; three.i = first.i * second.i; return three; }; ostream &operator<<(ostream &out, myclass &prm1) { out << prm1.i; return out; }; При вызове функции myclass a1,a2; cout << um(a1,a2); // error
MAC
why don't it works?
MAC
Can be a problem in myclass, does it give some meaningful errors?
<stdin>:42:7: error: invalid operands to binary expression ('std::__ndk1::ostream' (aka 'basic_ostream<char>') and 'myclass') cout << um(a1,a2); ~~~~ ^ ~~~~~ /data/user/0/ru.iiec.cxxdroid/files/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../include/c++/4.9.x/type_traits:4753:3: note: candidate function not
Pavel
because maybe it fails to pass temporary as mutable ref, not sure
Vlad
It couldn't bind temporary to a lvalue reference
Vlad
If there aren't const ref ?
Gee man fix your grammar) I have a hard time understanding you
Vlad
What do you mean ? Why can't bind ?
result of a function is the rvalue
Vlad
rvalue can be bind to a const reference