Anonymous
labyrinth
i cant understand that BAIDU_CACHELINE_ALIGNMENT is used for
Anonymous
labyrinth
ahh found it, i didnt expect it to be attribute, which is extensively used in memory alignment for struct i suppose ?
Anonymous
/warn @abhiVerma200 pming
Anonymous
Have a aaray of type struct Node *A with malloc
Anonymous
/get ide
Anonymous
/get ide
Anonymous
well this https://codecondo.com/top-10-ide-for-c-and-cplusplus-for-programmers/ is kinda more appropriate, don't you think?
Vlad
Vlad
So I really don't think so
Anonymous
Vlad
Anonymous
ok how about this https://www.slant.co/topics/10211/~c-ides
Asad
Let's run this sort of survey in this group. Shall I create and send the poll?
Vlad
Aman
https://pastebin.com/LehfcJH9
Aman
getting this output for above program
Aman
No of duplicates is 1061758308
Aman
why I am getting this random no output if possible then tell me because i am new to c.
Aman
@dkuch_idr your soution works btw
Aman
thank u for that
shayan
Hi,can anyone introduce a java and python programming group?
Igor🇺🇦
Henry
Hi please i am really stuck choosing the most useful btw Let us C and C modern approach,
I have read the /get post but i need your opinion please
Henry
Please It draining my focus
Jas
Please It draining my focus
Your question does not make sense. Rephrase it and try again. However if you’re already losing patience C/C++ might not be for you.
Henry
Anonymous
If I am a asking about book why u are giving me a warning
Jas
It’s in the rules.
Georges
Hello, i want to ask how can i create a struct in c++ that is not copyable.
Pavel
To follow "the rule of 5" you can also delete the move constructor and move assignment operator, and = default the destructor
Georges
Oh okayy
Thank you my friend
Promise
Pls WhatsApp link for SQL
Anonymous
Roxifλsz 🇱🇹
Aman
@JRandomGuy I now understood my mistake .Btw thanks for caring about me.
Eliud
/get ide
PO
hi
PO
I would like to use fget() in function
PO
but i dont know what is the type of return of fget()?
Vlad
Igor🇺🇦
Anonymous
PO
Where did you look?
google, I want just do some things like that if (getc() != char){
constinue ;
} else{
go next line with fscanf();
}
shayan
AHMED
#include<iostream>
#include<any>
#include<string>
using namespace std;
int main(){
any a = 5;
any b = 8.9;
any c = false;
any d ='v';
any e = "You are doing a great job. I am proud of you.";
cout<<any_cast<int>(a)<<endl;
cout<<any_cast<double>(b)<<endl;
cout<<any_cast<bool>(c)<<endl;
cout<<any_cast<char>(d)<<endl;
cout<<any_cast<string>(e)<<endl;
return 0;
}
AHMED
5
8.9
0
v
terminating with uncaught exception of type std::bad_any_cast: bad any cast
Aborted
[Program finished]
AHMED
How to safely access string using any container?
Vlad
Vlad
Or create a temporary string as Pavel suggested
AHMED
AHMED
AHMED
I wrote this code....and it worked.
Thanks again
AHMED
#include<iostream>
#include<any>
#include<string>
using namespace std;
int main(){
any b = string("u r awesome");
any c = "hello again";
cout<<any_cast<string>(b)<<endl;
cout<<any_cast<const char*>(c)<<endl;
return 0;
}
PO
#Comment
P1
6 10
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
1 0 0 0 1 0
0 1 1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0
static void detector(FILE *opf){
assert(opf != NULL);
char firstCharacter = getc(opf);
printf("--------------%c\n", firstCharacter);
if(firstCharacter == '#'){
fscanf(opf,"%*[^\n]");
printf("Comment line detected\n");
}else{
printf("Comment linet not detected \n");
fseek(opf, 1, SEEK_SET);
fprintf(opf,"%c",firstCharacter);
}
}
Why gtc() and fgetc(), change the P1 to P0?
PO
🙏🏻 please
abhi3700
PO
Igor🇺🇦
PO
Igor🇺🇦
okay just give a min to try
I have no idea what your program is supposed to do though. So don't know what's expected behaviour
Igor🇺🇦
PO
MY FILE IS
P1
6 10
0 0 0 0 1 0
#Comment
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
1 0 0 0 1 0
0 1 1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0
I have to find the comment line which begin with # and ignore them them while or before scanning or remove them and then rewrite it into new file
PO
Igor🇺🇦
Igor🇺🇦
I think it will be simpler
⚛ Hz
You could build a simple state machine
⚛ Hz
It "peek" the first character to decide the next state (comment or useful data)
PO
Igor🇺🇦
⚛ Hz
Assume there only two type of line