Ибраги́м
This should be named LOL 3.4
Anonymous
Can anyone send me some links for C output problem...
Anonymous
Avezy
Avezy
feels bad xD
Anonymous
Avezy
olli is always a bit qucker / more exact
Anonymous
Haha
Anonymous
Avezy
https://www.tutorialspoint.com/compile_c_online.php
olli
So it will break at the space?
the format string is quite similar to the one in (f)printf. "%c %d %d %d" means, read any number of whitespaces followed by a character, then read any number of whitespaces followed by a number and so on.
So in the end you read a char and three integers (seperated by whitespaces).
the following will print a 123 456 789.
char c;
int x, y, z;
sscanf("\na 123 456\n789", " %c %d %d %d", &c, &x, &y, &z);
printf("%c %d %d %d\n", c, x, y, z);
Avezy
You can try what it does helps me atleast
Anonymous
found an interesting article
Anonymous
did you removed the tags bot ?
Anonymous
So guys I've a problem.
I am taking input Q lines.
Each line has an arbitrary set of numbers separated by spaces.
Ex Input:
Q = 4
23 43 54 2
1
12 32 43 5 4
2 324 42
Then I've to process those numbers.
So what I am doing is, I am taking input each line as a string and then extracting the nos as strings and then using atoi function to convert them to int.
Surely there is a better way to do this?
Anonymous
while(Q>0){
string s;
getline(cin,s);
s +=" ";
for(char c:s){
if (c==' '){
x=atoi(temp.c_str());
temp = "";
//process x
continue;
}
temp +=c;
}
Q--;
}
^^looks bad :c
BinaryByter
there isn't really
BinaryByter
if you want to make it look better, split the tasks into very small functions
Anonymous
for each exist on cpp?
BinaryByter
it does on stl compliant containers
BinaryByter
for (auto i : my_vector)
Anonymous
BinaryByter
wait C++ fors have continue?
BinaryByter
NICEEE
Anonymous
Yeah y
BinaryByter
that makes like... everything easier
Anonymous
Avezy
BinaryByter
bae
BinaryByter
💜
Avezy
yes it works
BinaryByter
💜YAAYYY
Box of
So I've got an interesting issue. I have ftrace.h that when I try to compile I get 2 errors:
error: implicit declaration of function ‘strncmp’ [-Werror=implicit-function-declaration]
(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
error: implicit declaration of function ‘strncmp’ [-Werror=implicit-function-declaration]
(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
here's problematic part of code:
static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
{
/*
* Compare the symbol name with the system call name. Skip the
* "__x64_sys", "__ia32_sys" or simple "sys" prefix.
*/
return !strcmp(sym + 3, name + 3) ||
(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
}
Box of
any idea how to fix it?
Dima
Dima
Dima
Anyways, good luck
BinaryByter
schoffal.com
Anonymous
Please send basic notes for c language
Anonymous
Anonymous
Anonymous
Anonymous
don't shitpost here , for shitposting use the Offtopic group
Anonymous
Anonymous
Ok sorry for posting
Anonymous
^ here is the magic link to transer you to the offtpoic group where shitposting is encouraged
Javier
I have to implement a function which reads this kind of input:
{a, b, cde}
The fuction should just read the words and insert them into a set, without the "," " " or "{}", but I'm stuck. I've try using getline with the "," delimiter but I think it's not working
BinaryByter
get the entire line and then parse it
BinaryByter
https://github.com/Wittmaxi/webcpp/blob/master/src/env_variables.cpp
BinaryByter
look at how I made the GET and POST parsers
BinaryByter
they are pretty similar to your question
BinaryByter
no, read it completely and then parse it
BinaryByter
from { to , then from , to , and then from , to }
Javier
I don't know if I should use string::find() or algorithm::find()
BinaryByter
BinaryByter
with the , its unwise since you have two of em
BinaryByter
BinaryByter
take those two functions as reference
Javier
Ok. I'm reading the whole line with
string::getline()
. Now I should call getuntil "," then remove, and so on?
Anonymous
How to set environment variable for thread stacksize
Dima
BinaryByter
what is neko-webframework?
Dima
My web framework and server
Dima
Anonymous
Sandeep
Please send me software where I can program c and c++.
Anonymous
Dima
Anonymous
Thanks
Anonymous
Sandeep codeblocks for Windows ..xcode for Mac
Anonymous
@MissRose_bot thanks a lot , I am not a professional programmer though,.
Javier
Can I overload operator= reciving two objects?
Sandeep
Javier
In order to do something like:
object = (var1, var2)
and it'll call set method