So you're saying try to use rename() / link() and if it fails because the temp file is on a different filesystem, then manually read the temp file and write it to the new file? Back in the 90's,...
Type: Posts; User: Spork Schivago
So you're saying try to use rename() / link() and if it fails because the temp file is on a different filesystem, then manually read the temp file and write it to the new file? Back in the 90's,...
Thank you for your response Laserlight. The reason rename() won't work is because in Linux, usually the /tmp directory is a different filesystem that's mounted at boot. OpenSUSE does it this way,...
Hello,
Could someone give me some ideas on what they consider to be the best way to rename / move a file in C? My program will run in Windows and in Linux. The rename() function isn't really...
Thank you! That's what I was missing. Much appreciated!
I am so stupid. I forgot to initialize the integers to 0. So when I was testing the values of the various integers, some were coming back as being set. So, another question though. In the...
Thank you for the reply Salem. I have been trying to experiment with the getopt_long function and I have been using printf / fprintf statements to try and figure out what the flag variable does, but...
Hello,
I'm writing a program. I'd like it to be compatible with MinGW's C compiler and Linux. Right now, I'm writing the code in Linux. I'm not 100% sure MinGW has the getopt_long function...
If it was my system, I'd check the electrolytics caps first. If you have an ESR meter, just pull the caps and check them. If not, it wouldn't hurt to do a physical inspection of the caps on the...
Hello,
Could someone please point me to some in depth documentation on the LHA archive format, in English? I'm only interested in the LH5 method right now. I'd like to write a custom C program...
Also, in your new program, the indentation is a bit messed up. If someone was reading through it quickly, it looks like your switch(b) is by itself, when in reality, it's part of your case 4:...
Does this code compile? On my system, it doesn't. I can see a few problems with your code. Your style of indentation makes it a bit hard to read. First off, I believe your do while loop is...
I made a mistake, actually, I've made a few. Guess it's time to call it a night and relook at things tomorrow. Just been a long day. I figure when I'm making mistakes like this, there's no...
Thank you. So PRIx32 works for unsigned and signed? I don't have to specify that it's unsigned?
Yes, I do include stdio.h, I just didn't copy and paste it into my post. I didn't think it was necessary. Sorry. It is included though.
I'm pretty sure I need to use the PRI macros here because I don't know a head of time what size the variable is. For example, uint32_t might be different sizes on different systems (ie, 32-bit vs...
%x doesn't work. It gives a warning.
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Hello,
How can I print a uint32_t type variable in hex? Here's my code and the output:
/* types.h */
#ifndef __MYTYPES_H__
#define __MYTYPES_H__
#include <stdint.h>
Also, adding to what Cas said, I found sometimes the order of the libraries matter. For example, trying something like this might fix your problem:
gcc gntring3_read_async.o...
How are you creating the text file? What OS are you in? In Linux, when I compile your code (with the airports.txt file created), it displays:
Airport City/State Population Lat Lon
Seems to...
Boy do I feel stupid, you linked to the 2nd edition! Sorry about all that!
For C Programming, A Modern Approach, by K.N. King, I believe only the second edition tries to fully cover C99. I might be wrong, but I think the first edition covered C++ stuff whereas in the...
Could you show the rest of your code? The two functions NumberOfDigits(...) and DthDigitOfX(...). Also, why are you declaring them inside the IsArmstrongNumber(...) function?
int...
Oh, the reason the second example works is because you're doing the type cast to float by putting a .0 after the decimal. You're no longer dividing an integer by an integer. You're now dividing a...
I might of worded that a bit better. When I said you was using the wrong formula, what I meant was you're using:
cDegrees = (fDegrees-32)*(5/9);
As Cat has previously noted, one of your...
I was going to point out he was using the wrong formula and that he should also be using atof but you beat me to it. For the OP though, here are some other formulas you can use as well.
C = (F -...