|
|
Up |
  |
Author: bismark90bismark90
Date: May 15, 2008 09:01
I have been working through K&R and I was curious about finding some
solutions to the exercises. A Google search brought up this site[1].
Does anyone know what is the status with this site? It appears to be
dead. I attempted contacting the maintainer, but the email address
bounces back my message. Is there another up to date site with this
information? Thanks!
-bismark90
[1] http://users.powernet.co.uk/eton/kandr2/
--
comp.lang.c.moderated - moderation address: clcm@ plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
|
| |
|
| |
no comments
|
|
  |
Author: angel_tsankovangel_tsankov
Date: May 12, 2008 23:06
It's been some time since I started wondering why the C/C++ languages
do not have a non-null pointer (something like a copyable C++
reference)? In my opinion, using non-null pointers instead of the
"traditional" ones (wherever appropriate) would provide the following
benefits:
-allows restrictive programming techniques to be apllied at a lower
cost (e.g. if a pointer passed to a function may not be null, there
would be no need for a null-check before dereferencing it);
-allow for improvements in programming practices (having two types of
pointers will bring to attention the difference between them, namely
the possibility that "traditional" pointers can be null, hopefully
thus making it more obvious that "traditional" pointers should be
checked for null before thay are dereferenced);
-allow for more reliable code (having a "traditional" pointer where a
non-null pointer would do increases the risk of undefined behavior; on
the other hand, using a non-null pointer instead would be safer);
-provide compilers with further semantic information, thus enabling
them to perform more optimizations;
-make source code more concise (as a result of having fewer null-tests
when replacing "traditional" pointers with non-null ones). ...
|
| Show full article (1.47Kb) |
|
| |
3 Comments |
|
  |
Author: icarusicarus
Date: May 9, 2008 15:33
Hi, this is a simple temperature converter (Fahrenheit to Celsius to
Kelvin). Using gcc 4.0.
The user is supposed to enter q or any other non-character to exit the
program.
Problem with this code:
I enter 'q' as soon as the program starts. It hangs.
Then run it again. Enter a number, it executes fine. But when I enter
q, it repeats last number and it doesn't 'pay attention' to the letter
entered.
Any ideas on how can I fix it? thanks in advance.
#include
const double F_TO_CELS_ONE_EIGHT = 1.8;
const double F_TO_CELS_THIRTYTWO = 32.0;
const double C_TO_KELVIN = 273.16;
void Temperatures(double f_temp);
int main(void){
double f_temp;
char quit;
|
| Show full article (1.41Kb) |
|
3 Comments |
|
  |
Author: iavianiavian
Date: May 8, 2008 00:20
I am trying to compile a code that includes header from both oracle
and postgres
/usr/local/pgsql/include/server/c.h:420: error: conflicting
declaration 'typedef struct varlena text'
/ opt/oracle/product/10.2.0/rdbms/public/oratypes.h:196: error: 'text'
has a previous declaration as `typedef oratext text'
How do i fix this ?
--
comp.lang.c.moderated - moderation address: clcm@ plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
|
| |
|
3 Comments |
|
  |
Author: VickynathanVickynathan
Date: May 8, 2008 00:20
The following code snippet works. I wonder how ? ( this is a code for
microcontroller )
void main (void){
unsigned char xdata * data pwrite;
unsigned char code * data pread;
unsigned char test_array [16];
unsigned char temp;
....
....
....
pwrite = (unsigned char xdata *) Scratch_Flash_Addr ; // I have
never seen such an initialization ??
pread = my_array ;
.....
.....
|
| Show full article (0.88Kb) |
|
7 Comments |
|
  |
Author: ccie15672ccie15672
Date: May 5, 2008 14:01
I work for an application-service provider.. sort of... anyway. One
of our many applications is actually a TN3270/telnet application which
has hooks into a microsoft IE DLL to tunnel/encrypt the user traffic
over SSL. So on the network, we see encrypted packets destined to/
from port 443.
This traffic hits a load-balancer that offloads the SSL encrypt/
decrypt process.
We are having an issue where, it seems, everything a single user does
(like just login, or pull up a VT100 screen) ends up launching 8-12
TCP connections. Over the course of a day 160 users launched upwards
of 90000 tcp sessions.
We have many thousands of users (well in excess of 20000 users) that
use this application. Needless to say, this is starting to cripple
our load balancers.
Its my belief.. as an ex-programmer from a decade+ ago, that for the
duration a user is logged into this app there should be a single TCP
session. Maybe things are different now.
|
| Show full article (1.40Kb) |
|
no comments
|
|
  |
Author: C langC lang
Date: May 5, 2008 14:01
Can scanf be use as a function?if so plz describe.
--
comp.lang.c.moderated - moderation address: clcm@ plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
|
| |
|
4 Comments |
|
  |
Author: PaulPaul
Date: May 5, 2008 14:01
I would like to define a list of parameters, and then pass them to a macro.
However, the compiler (gcc) only sees one parameter, rather than expanding
the definition.
Could anyone suggest a way of making this work (using the preprocessor)?
#define MyList 1,2,3,4
#define Sum(a,b,c,d) a+b+c+d
x = Sum(MyList);
--
comp.lang.c.moderated - moderation address: clcm@ plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
|
| |
|
3 Comments |
|
  |
Author: PaulPaul
Date: May 5, 2008 14:01
How do I find the length of strings within an array at compile time?
The following is not safe:
const char* MyStrings[] =
{
"one",
"two",
"three",
"end marker"
}
#define StringLength(index) MyStrings[index+1] - MyStrings[index]
Since the strings may not be placed consecutively, or in order, within
memory.
Also
#define String1 "one"
#define String2 "two"
#define String3 "three"
|
| Show full article (0.87Kb) |
|
2 Comments |
|
  |
|
  |
Author: adindaadinda
Date: May 5, 2008 14:01
So what i need is this; (I'm very new at this,, programming in C I
mean...)
In matlab I had a while loop, and after each loop was done I added my
resulting matrix to an object. Seeing the loop is conditional to my
results I do not know in advance how many loops I need. The matrices
are Nx * Ny* Nz*6.
In C I put my matrices into 1D arrays. So I thought that if I use a
counter for each time i do a loop and the calloc and realloc function
that would work...But it doesnt seem to be working...Hope one of you
can help me.
This is a sample text which i use to test my programs...
Vnulpoint is my result matrix for which i used pointers. So Varray is
supposed to contain each of the Vnulpoint matrices...
#include
#include
#include
#define nx 2
#define ny 2
#define nz 2
|
| Show full article (5.49Kb) |
|
no comments
|
|
|
|
|