comp.lang.c.moderated
  Home FAQ Contact Sign in
comp.lang.c.moderated only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c.moderated Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  pressing 'q' or non-numeric char to exit loop/program         


Author: icarus
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
  OCI and Postgres - Compile error         


Author: iavian
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
  Pointer initialization and usage.         


Author: Vickynathan
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
  too many TCBs opened         


Author: ccie15672
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
  Scanf         


Author: C 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
  defining macro parameters         


Author: Paul
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
  Length of Strings in an Arrray (at compile-time)         


Author: Paul
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
  translation from matlab to C object containing matrices undefined length of object         


Author: adinda
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
  Using C to launch an application         


Author: MarkF
Date: May 5, 2008 14:01

I'm new to programming. I am a Software Test Engineer. I am trying
to write a program that launches a HyperACESS executable and then
inputs a bunch of integers and characters into the application. I was
thinking of using the system() function like so: system("cd C:\Program
Files\HAWin32\HAWIN32.EXE") but thats as far as my feeble mind has
taken me. If using the system() function is the best way of going
about this can someone point me to a good example of using system() in
this manner? If not, any suggestions?

Thanks,
-Mark
--
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
  what does ... mean in printf??         


Author: AKM
Date: May 5, 2008 14:01

Hi,
In the protype of printf function, what does the ... mean.
int printf(const char *format, ...)

I undestand that this function can take variable number of arguements.
How is it handled? what is it called?

Thanks in advance
AKM
--
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.
5 Comments