comp.lang.c - 5 new messages in 5 topics - digest
comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en
Today's topics:
* `********AMAZING HOT PHOTOS & VIDEOS ******** - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/e28a32a3783fab60?hl=en
* comparison error - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/1ff4c112d53218ff?hl=en
* the loop control - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/0c275c4dfa791ca5?hl=en
* about NULL as a parameter to a libc function - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/28c6938cf9631a2a?hl=en
* no error by fscanf on reading from output file - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/94931e85d42a9a64?hl=en
==============================================================================
TOPIC: `********AMAZING HOT PHOTOS & VIDEOS ********
http://groups.google.com/group/comp.lang.c/t/e28a32a3783fab60?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Oct 29 2011 10:07 pm
From: lekha
FOR GOOD JOBS SITES TO YOU
http://goodjobssites.blogspot.com/
HOT KATRINA KAIF PHOTOS
http://actressgallery-kalyani.blogspot.com/2011/09/katrina-kaif.html
AISHWARYA RAI HOT HQ PHOTO STILLS
http://actressgallery-kalyani.blogspot.com/2011/09/aishwarya-rai.html
ASIN HOT PHOTO GALLERY
http://actressgallery-kalyani.blogspot.com/2011/09/asin.html
SAKUNI MOVIE STILLS
http://actressgallery-kalyani.blogspot.com/2011/10/sakuni-movie-stills.html
7TH SENSE MOVIE STILLS
http://actressgallery-kalyani.blogspot.com/2011/10/7th-sense-movie-stills.html
MOGUDU MOVIE STILLS
http://actressgallery-kalyani.blogspot.com/2011/09/mogudu-movie-stills.html
HANSIKA MATOWNI LATEST HOT STILLS
http://actressgallery-kalyani.blogspot.com/2011/09/hansika-motwani.html
KAJAL AGARWAL HOT PHOTOS
http://actressgallery-kalyani.blogspot.com/2011/09/kajal-agarwal.html
TAMANNA SIRUTHAI HOT MOVIE STILLS
http://actressgallery-kalyani.blogspot.com/2011/09/siruthai-movie-stills.html
SNEHA HOT GOA MOVIE STILLS
http://actressgallery-kalyani.blogspot.com/2011/09/goa-movie-stills.html
FOR ONLY HOT GUYS SEE THIS
TRISHA HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/08/trisha-hot.html
TAMANNA HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/08/tamanna-hot.html
PRIYAMANI HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/09/priyamani-hot.html
KAJAL AGARWAL LATEST HOT WITHOUT TOP
http://hotactress-kalyani.blogspot.com/2011/08/kajal-agarwal-hot-photos.html
SAMANTHA LATEST HOT STILLS
http://hotactress-kalyani.blogspot.com/2011/09/samantha-hot.html
SNEHA ULLAL HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/10/sneha-ullal-hot.html
ANJALI HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/10/anjali-hot.html
HANSIKA MOTWANI HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/10/hansika-motwani-hot.html
PRANITHA LATEST HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/09/pranitha-hot.html
HOT KATRINAKAIF WALLPAPERS
http://hotactress-kalyani.blogspot.com/2011/08/katrina-kaif-hot.html
HOT MALLU ACTRESS BHAMA
http://hotactress-kalyani.blogspot.com/2011/09/bhama-hot.html
TOLLYWOOD HOT ACTRESSES
http://hotactress-kalyani.blogspot.com/2011/08/hot-actrsess.html
SONAKSHI SINHA HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/09/sonakshi-sinha-hot.html
PRIYANKA CHOPRA LATEST HOT PHOTOS
http://hotactress-kalyani.blogspot.com/2011/08/priyanka-chopra-hot.html
LATEST AMISHA PATEL HOT PICS
http://hotactress-kalyani.blogspot.com/2011/08/amisha-patel-hot.html
TAPSEE DIFFERENT STILLS
http://hotactress-kalyani.blogspot.com/2011/08/tapsee-hot.html
==============================================================================
TOPIC: comparison error
http://groups.google.com/group/comp.lang.c/t/1ff4c112d53218ff?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Oct 29 2011 10:37 pm
From: Barry Schwarz
On Fri, 28 Oct 2011 22:35:33 -0400, "Bill Cunningham"
<nospam@nspam.invalid> wrote:
>
>"Morris Keesan" <mkeesan@post.harvard.edu> wrote in message
>news:op.v31f8wyf5qv6o3@toshiba-laptop...
>
>[snip]
>
>> Bill seems to be off his meds again, and I have no real idea what this
>> code was intended to do. Even if he meant to iterate through the loop
>> until ((a = fgetc(fp)) == EOF), I can't guess what he intended by
>> writing a back to the same file.
>
>[snip]
>
> I am looking to write something like nano. Or the old pico. Maybe I
>should be using stdout and stdin instead of writing code that would just act
>as *nix's cp command. I guess that's just about the jist of it. And it's
>going to take a lot more than just opening and closing files. There will
>need to be a buffer for entering text. Some other type of API might be
>needed other than just c89-99.
It was bad enough when you would take haphazard stabs at coding but
now you seem to be generating sentences at random.
--
Remove del for email
==============================================================================
TOPIC: the loop control
http://groups.google.com/group/comp.lang.c/t/0c275c4dfa791ca5?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Oct 29 2011 10:47 pm
From: "Philip Lantz"
On Sat, 29 Oct 2011, Joe keane wrote:
> Which is better?
>
> ...
int fc(int fool, struct foo *foob)
{
...
for (int i = 0; i < fool; i++)
{
...(foob[i])
}
...
}
==============================================================================
TOPIC: about NULL as a parameter to a libc function
http://groups.google.com/group/comp.lang.c/t/28c6938cf9631a2a?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Oct 29 2011 11:41 pm
From: Jonathan Leffler
On 10/28/11 1:49 AM, gaoqiang wrote:
> a good function should deal with unwanted parameters.
>
> why memcpy,strcmp .etc, these libc functions, do not
> accept NULL pointer? called with NULL, just get segment
> fault. for efficiency?
>
> any idea?
ISO/IEC 9899:1999 says, in §7.1.4 "Use of library Functions":
Each of the following statements applies unless explicitly stated
otherwise in the detailed descriptions that follow: If an argument to a
function has an invalid value (such as a value outside the domain of the
function, or a pointer outside the address space of the program,
or a null pointer, or a pointer to non-modifiable storage when the
corresponding parameter is not const-qualified) or a type (after
promotion) not expected by a function with variable number of arguments,
the behavior is undefined. If a function argument is
described as being an array, the pointer actually passed to the function
shall have a value such that all address computations and accesses to
objects (that would be valid if the pointer did point to the first
element of such an array) are in fact valid. [...]
So, the C standard explicitly says that you invoke undefined behaviour
if you pass null pointers to a function that does not expect them. And
that in turn means that any behaviour is correct.
You should also look at the TR24731-1 'Safe' functions (available from
the JTC1/SC22/WG14 - C Standard Committee web site:
http://www.open-std.org/jtc1/sc22/wg14/).
--
Jonathan Leffler <jleffler@earthlink.net> #include <disclaimer.h>
==============================================================================
TOPIC: no error by fscanf on reading from output file
http://groups.google.com/group/comp.lang.c/t/94931e85d42a9a64?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Oct 29 2011 11:59 pm
From: "V.Subramanian, India"
This question is for learning purpose only.
Consider the program sample.c :
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main()
{
errno = 0;
FILE *fp = fopen("data.txt", "w");
if (fp == NULL)
{
fprintf(stderr,
"Could not open input file - data.txt\n%s\n",
strerror(errno));
return EXIT_FAILURE;
}
if (fprintf(fp, "test data") < 1)
{
fprintf(stderr,
"could not write message into data.txt\n");
return EXIT_FAILURE;
}
fflush(fp);
int a;
int b;
errno = 0;
// I deliberately try to read from the file
// opened in 'write' mode
if (fscanf(fp, "%d%d", &a, &b) == 2)
{
fprintf(stdout,
"a = %d, b= %d\n",
a,
b);
fflush(stdout);
fclose(fp);
return EXIT_SUCCESS;
}
int err = errno;
if (ferror(fp))
{
fprintf(stderr,
"Error encountered while reading input"
" from file\n%s\n",
strerror(err));
fclose(fp);
return EXIT_FAILURE;
}
fclose(fp);
return EXIT_SUCCESS;
}
In this program I open a file 'data.txt' in 'write' mode.
Subsequently, I write something into this file. Then I read
from this file using 'fscanf'. This operation should fail.
But when I test the error indicator for the stream by
calling 'ferror(fp)', the statements inside the
if (ferror(fp))
{
}
are NOT executed.
Does this mean that error inidcator for the stream is not set
by 'fscanf' ? Isn't the operation 'reading from a file
opened in "write" mode' an error ?
I am unable to understand this.
Kindly explain.
Thanks
V.Subramanian
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en
To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home