ex4_mp1e
What is the best C or C++
ex4_mp1e
c++
👍👍
ZukiZest
i'm learn c cuz l need more information
Mat
What is the best C or C++
Different languages for different purposes
Asdew
What is the best C or C++
I find C more fun.
Artöm
is the C
Doesnt matter
Abhishek
Consider int val=0xFACE; Write expressions using bitwise operators that do the following: A. test if atleast three of the last four bits (LSB) are on B. reverse the byte order (i.e., produce val=0xCEFA) C. rotate four bits (i.e., produce val=0xEFAC)
Abhishek
Unable to solve b part
Abhishek
Ok thanks sir
Artöm
Use shifts and ors
Abhishek
I took 12 instead of 4
Abhishek
Abhishek
Not getting correct output for bpart
Abhishek
@das_3sz3tt
Artöm
Is it B?
Abhishek
No it consists all 3 three part
Abhishek
The int bpart variable is the b ques
Artöm
The int bpart variable is the b ques
Why 4 then? You need to move bytes around, not half bytes
Anonymous
It may be 32 bits in ones compilers inplementation
I know. When you can write a program that is independent of implementation, why are you writing for a specific implementation?
Artöm
Because thats simple non-production task which doesnt give a shit about sizeof int
Abhishek
So should I use unsigned int
Abhishek
Artöm
Yes
Abhishek
Ok
Artöm
unsigned is good for bit stuff
Abhishek
Done thank u very much
Danijel Markov: Paget96 (Dan)
Can someone helps me out creating a function for reading files. Function should contain arguments, in this case passing the file path and should return content of a file as a string. I know JAVA pretty well, but now I have to do some small C++ lib for my Android app, so it's like first time trying C++. Thanks
BLK
Have you heard name C-- language?
Nomid Íkorni-Sciurus
Have you heard name C-- language?
it is a language that the GNU compilers suite use as intermediate between the source and the actual assembly.
BLK
👍👍
MᏫᎻᎯᎷᎷᎬᎠ
Can someone helps me out creating a function for reading files. Function should contain arguments, in this case passing the file path and should return content of a file as a string. I know JAVA pretty well, but now I have to do some small C++ lib for my Android app, so it's like first time trying C++. Thanks
Soo Let me guess You are learning C++ through Android development Anyway Here is the code #include <fstream> using namespace std; string readFile(const char* filename){ ifstream in(filename); string text; while(in.good()){ string temp; getline(in, temp, '\n'); text += temp; } return text; }
My Hope
Guys pls tell me is there any c+++ app for mobile android
MᏫᎻᎯᎷᎷᎬᎠ
> using namespace std
I remembered you when I wrote that line xD
MᏫᎻᎯᎷᎷᎬᎠ
Yeah Don't prefer to use "using namespace std"
MᏫᎻᎯᎷᎷᎬᎠ
I just didn't want to write much
MᏫᎻᎯᎷᎷᎬᎠ
Guys pls tell me is there any c+++ app for mobile android
Yeah CxxDroid You can find it in google play
Nameful
:^)
MᏫᎻᎯᎷᎷᎬᎠ
You are welcome
Danijel Markov: Paget96 (Dan)
You are welcome
getline(); makes a problem in this case
Danijel Markov: Paget96 (Dan)
crt
in should be a char** buffer to put lines it
crt
the '\n' should be the FILE* to read from
crt
i see
Danijel Markov: Paget96 (Dan)
i see
im basically never used C++
klimi
my eyes
Danijel Markov: Paget96 (Dan)
my eyes
mine either
Dima
read the rules
Danijel Markov: Paget96 (Dan)
read the rules
Yes, i have checked
Anonymous
I am a software engineer and student of IIT BHU , I made a complete lecture series on Competitive Programming.
Anonymous
Plzz allow me to send the link of the channel.
Anonymous
In this series , I start from scratch and will go upto Advance level.
Anonymous
Name of the channel is SHAILENDRA UPADHYAY
Anonymous
you can go and learn from there.
Aqib
https://vm.tiktok.com/baXaLu/
Dima
group* lol
Aqib
Oh ok
Aqib
Soory for this
Anonymous
Hey
ZukiZest
l need help not output https://pastebin.com/0XaQBjVD
gene_ene
hello. I need help to know my error. This is the code i wrote to check if any two elements in the same row of a matrix are equal. If the element is '0' i dont want it to check.However this code shows segmentation fault whenever the if condition becomes true. for(int i=0;i<no_hours;i++){ for(int j=0;j<no_rooms;j++){ if(houroom[i][j]==0) continue; for(int k=(j+1);k<no_rooms;k++){ if(decrypt(houroom[i][j])==decrypt(houroom[i][k])){ cout<<"."; check_avail(i,k); } } } }
gene_ene
i learnt on the web that segmentation fault is due to bad allocation of memory but how does that fit here?
Igor🇺🇦
i learnt on the web that segmentation fault is due to bad allocation of memory but how does that fit here?
It looks I or J are larger than your array and you're getting out of bound error
gene_ene
Thankyou @dunklecat and @JRandomGuy but the problem was somewhere else and i was uselessly staring at that bit. Its' solved now.
nelnel
hi
Anonymous
hello
klimi
hello
Anonymous
std::string path("G:\\"); for(auto& p: fs::recursive_directory_iterator(path)) { p.replace_extension(".code"); }
Anonymous
std::string path("G:\\"); for(auto& p: fs::recursive_directory_iterator(path)) { p.replace_extension(".code"); }
what problem? Error] 'const class std::filesystem::__cxx11::directory_entry' has no member named 'replace_extension'