« first day (426 days earlier)      last day (2651 days later) » 

01:42
If I might ask,
the C standard has an API, such as fscanf, vfscanf, but where those naming came from? for example, how do I know what setvbuf stands for? There must be some document which explain why these function naming choosen, but unfortunately I can't find it anywhere in the Internet. Would you like to help me?
@Unknown123 On a global level, there's almost no system to the naming. Sorry.
@JerryCoffin would you like to help me then, what does setvbuf stand for?
01:57
@Unknown123 Probably "set variable buffer".
@JerryCoffin That's make a lot more sense, I thought it was variadic. I just remembered vfscanf and vfprintf
@Unknown123 I'd guess there the v stands for va_list (but it's hard to be certain).
 
9 hours later…
11:32
Hey guys, I wanted to ask one thing. I'm using ifstream to read files and what I've noticed is that there are around 30%-40% in which I get a file read error. This is how I check it.

is.open(ituple.get_fileName().c_str(), std::ios::binary);
if (!is)
{
SPLLOG(L_ERROR,
"unable to open the file '" << ituple.get_fileName()
<< "'", "file_reader");
}
How do I find the exact reason for the file read error?
12:07
2 messages moved from Lounge<C++>
@JRodDynamite you might be able to inspect errno (try perror("open")) althought that's not portable. Otherwise, use std::filesystem or boost::filesystem e.g. to check the file exists, is accessible etc.
 
8 hours later…
19:51
@JerryCoffin hm, the C Rationale says only "setvbuf was adopted from UNIX System V", could V stand for SysV?
20:16
Nope.
There's a lot of "naming conventions" (cough) going around, but the only things that show "subsystem reference" inflictions are actually consistent (like, pthread_* etc)
M-J
M-J
21:12
Hi everyone
I have a question. Why is it said in all tutorials that when the number of cpp files in our project grows, we need to compile all the other files from scratch as well(assuming we don't want to use make utility in GCC)? Well, I thought if our program is modular, we can take only one single cpp file and compile it without any side effects...
It seems that I'm wrong, but I don't know the reason of it. Can anyone please clarify this for me?
nwp
nwp
Typically different cpp files include the same header, so once a header changes all the cpp files that include that header need to be recompiled and all cpp files that include a header that includes a changed header must be recompiled and so on.
In theory there are build systems that take care of this and recompile the required files automatically. In practice they all fail getting the dependencies right (there may be one I'm not aware of that gets it right).
M-J
M-J
@nwp But why? When something is recompiled, a new object file is created which is associated with the "SAME" header name... So other cpp files will not know anything and once we build the project, the linker will use the "NEW" object file...
nwp
nwp
What do you mean by object files being associated with header files?
Typically a.cpp doesn't only #include a.h. It also #includes b.h, so when b.h changes you have to recompile a.cpp.
I got to go for a bit, sorry.
M-J
M-J
@nwp Thank you. I think I can understand it now.
@nwp Great example :)
 
1 hour later…
22:38
@M-J And to avoid getting the dependencies wrong, make sure the build tool detects them for you (gcc -Mxxx or just use cmake)

« first day (426 days earlier)      last day (2651 days later) »