Description:
The C programming language. (Moderated)
|
|
|
fgets - design deficiency: no efficient way of finding last character read
|
| |
Hello,
The last character read from fgets(buf, sizeof(buf), inputstream) is:
'\n'
OR
any character x, when no '\n' was encountered in sizeof(buf)-1
consecutive chars, or when x is the last char of the inputstream
***How can one EFFICIENTLY determine if the last character is '\n'??
"Efficiently" means: don't use strlen!!!... more »
|
|
which one is faster?
|
| |
on a 32bit system.
...struct TestStruct
{
unsigned short a;
unsigned short b;
unsigned int c;
...struct TestStruct t;
t.a = 0; //step 1
t.b = 1; //step 2
t.c = 2; //step 3
Questing is : Are these 3 steps having the same perfomance time?
Sorry for my poor english.... more »
|
|
Pointers and Memory-Mapped Files
|
| |
Hey everyone,
I'm attempting to work with a large file which multiple processes may read from and write to. I plan to use memory mapping to point to specific portions of the file I would like to modify. My question is how to properly handle an instance in which the file expands from the front,... more »
|
|
Rounding of doubles
|
| |
Has anybody used the functions such as fegetround and fesetround. What
do these functions return?
I'm trying to find a function which will round a double to
(1) the nearest integer, with 0.5 rounded to 0.0 and 1.5 to 2.0
(2) the nearest integer near zero, with 1.5 rounded to 1.0 and -1.5 to -1.0... more »
|
|
I/O in C99
|
| |
Hi,
Does C99 strictly require blocking I/O?
Can readers of this forum point to the section
in the C99 specification which state the rules
regarding I/O?
Sincerely,
Seima Rao.
-- comp.lang.c.moderated - moderation address: c...@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,... more »
|
|
Issues in building a shared library
|
| |
Hello,
I am trying to build a shared library called "libjxx.so" using Visual
studio2008 V9.0. The module contains both C & fortran routines. I am
making the C-source as start up project and linking the F-source
against it. I am also linking couple of other libraries called
libm7.lib & libm8.lib. I am getting the following errors concerning... more »
|
|
Struct & Arrays & passing to function, and the resulting array of confusion
|
| |
Hello and thanks for reading.
I like to write C programs as my hobby and I rarely use functions for
my projects simply because most of my efforts are workable in the
domain of main().
I have read much in the past two days and have tried changing my code
but I am not getting it so even though I have searched and read a... more »
|
|
Public Resources for C Programming, Particularly Video?
|
| |
What public or open-courseware resources are available for C programming particularly at an intermediate level? I have actually taken the CS50 course via Harvard Extension so I am looking for other resources. Coverage of data structures using C rather than Java would also be welcome. Prefer video resources (videotaped lectures in particular). Focus on Unix programming at the command line level also welcome. I am also going through K&R to reinforce my comfort with C even though I just finished the formal programming course.... more »
|
|
copying structure members shifts by one byte when using memcpy()
|
| |
Hi,
I am working in ubuntu linux 8.04 version and using gcc compiler for
compiling my application.
I am using a function as below
uint8 Message(uint8 u8SignalID, tstControlMessageData
*pstControlMessageData)
{
tstControlMessage stControlMessage;
uint8* char_ptr;
uint8 iCount;... more »
|
|
Glue to Re-define a Bunky Function?
|
| |
Hi,
Some code I'm working with uses the C string library function
strrchr(), but my compiler's implementation works in a non-standard
way. It can't seem to point to a string's first '\0' character with a
call like p = strrchr(dest, '\0');
In preference to altering the original code, I would like to somehow... more »
|
|
|