oh dear,
I think I'll go back to cabbing :(
text is the input value that I want to change, I put (int)(sizeof(output->circuit_length) to ensure that the right amount of space was being...
Type: Posts; User: darfader
oh dear,
I think I'll go back to cabbing :(
text is the input value that I want to change, I put (int)(sizeof(output->circuit_length) to ensure that the right amount of space was being...
thanks quzah, my schoolboy error of the day :(
thanks Dave, I'll use that ;)
Hi,
stuck on sprintf again....
#define BUFFER_SIZE 2048
void set_output_field(RecordOut * output, char * text, int field_number)
Hi,
I have to validate a number and my function isn't as good as I thought it was,
...snip
typedef struct {
char custcode [CUSTCODE_LEN];
yes Dave, it has worked for me too :D
sprintf(output->linkspeed, "%*d", LINKSPEED_LEN, atoi(input->linkspeed));
what I did not try before, was the atoi() function :(
thanks Dave,
sorry chaps to be so long replying,
I was not able to get sprintf to do it, so I had to do this,
...snip...
memcpy(output->usernbr, spacer(right_justify(input->usernbr,...
stuck on sprintf again,
(please note, that the dots are spaces but do not appear in the post, these values are all eight characters from a fixed length file)
I was hoping to change these...
wow
so it is perfectly obvious that the results I were getting was a fluke - not good
if start is now a static, how does it know to traverse through the continuous cycle of slash delimiters, I...
your right,
this has done it for me
#define ERROR_MESSAGE "EQ USERNBR INVALID - %s\n"
the filename is guarranteed to be 46 characters long, [otherwise the program would have stopped before now] so the null is being place on the end,
according to a printf statement I get the...
Hi,
how do I incorporate a value inside a string ?
strncpy(buffer, input.usernbr, USERNBR_LEN);
buffer[USERNBR_LEN] = '\0';
if(!isdigit(buffer) ||...
thanks Dave,
I have added it too :)
#define BUF_SIZE 256
#define SITA_FILE_LENGTH 46
char * get_filename(const char * path, char * buffer, size_t limit)
sorry twm, I put the declaration in the wrong header file and the char * buf was my schoolboy error of the day :(
thanks
thanks Hammer I thought so,
sorry twm, I cannot get your function to work
int main(int argc, char *argv[])
{
<snip>
char * filename_only;
Hi,
is there a standard function for removing paths from filenames ?
printf("filename [%s]\n", argv[1]);
/root/mydir/myfile.dat
I only want the filename myfile.dat, so do I have to work it...
excellent :D
thanks twm
Hi,
char format[64] = "1.51480724077861e-03";
char buffer[64] = "";
int number = 0;
printf("format [%s]\n", format);
thanks Dave,
that knocks mine into a cocked hat :)
sure
before
<more here>;P;LL;LN;0.00;2.40;;30/9/1998 00:00:00;;;;213.16;<more here>
<more here>;P;LL;LN;0.00;9.60;;17/6/1997 00:00:00;;;;303.29;<more here>
<more...
Hi,
I have to alter the format of a date in a string and have written this...
char process_date(FILE ** p_fp, char c)
{
char format[11];
int index = 0;
thanks velius
:)
Hi,
just a question of style, am I right in thinking these two are the same
*(my_array) = NULL;
my_array[0] = NULL;
and these two
*(my_array + i) = NULL;
because if the stream argument is NULL, fflush flushes all open output streams, or so I thought ;)
Hi Dave,
I was hoping to make a program that would be easier for the next maintenace programmer to follow,
I have an enumeration
#ifndef CIRP_ENUMERATION_H
#define CIRP_ENUMERATION_H
case TOTAL_USD:
sprintf(temp_buffer, "%030.3f", atof(text));
memcpy(output->total_usd, temp_buffer, (O_TOTAL_USD_LEN + 1));
printf("before [%s]\n", text);
printf("after [%s]\n",...