473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Weird lcc-win32 behaviour

While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with lcc-win32
under windows xp pro. In fact, under wedit, I can smoothly compile the
program but when I try to execute it it ends with an "abnormal termination"
and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce

The weirdness is greater if you think that cutting many lines of the program
and stopping the execution imediatedly after the line
fscanf(fp,"%d%d",&R,&C);

lcc-win32 chokes on the same exception.

Please help
Vittorio

For thoes who wants to have a go here is prog1.c

/* prog1.c */
/* PROGRAMMA 1
Il file matrice.txt (presente nella cartella esame) contiene alcuni dati
cosi' organizzati:
R C
a0,0 a0,1 a0,2 a0,3 ... a0,C-1
a1,0 a1,1 a1,2 a1,3 ... a1,C-1
a2,0 a2,1 a2,2 a2,3 ... a2,C-1
.......
aR-1,0 aR-1,1............ aR-1,C-1

dove R e C indicano il numero di righe e di colonne della matrice che segue,
e l'elemento generico ai,j e' un reale.
Si chiede di scrivere un programma che:

- legga questo file, trasferendo i valori in una matrice di reali (float)
allocata dinamicamente
- allochi una seconda matrice di reali delle stesse dimensioni
- ponga nell'elemento i,,j della seconda matrice la somma di tutta la riga i
e di tutta la colonna j della prima matrice
- scriva la matrice risultante nel file destinazione.txt, in modalita'
testo, con una sola cifra decimale per ogni elemento

Al termine chiudere i file e liberare la memoria. */
#include <stdio.h>
#include <stdlib.h>
void main(void){
int i,j;
int R,C;

/*Leggo matrice.txt,trasferendo i valori in una matrice m1 di reali
allocata dinamicamente*/
FILE *fp;
fp=fopen("matrice.txt","r");
fscanf(fp,"%d%d",&R,&C);

float **m1;
m1=(float**)malloc(sizeof(float*)*R);
for(i=0;i<R;i++)
m1[i]=(float*)malloc(sizeof(float)*C);

for(i=0;i<R;i++)
for(j=0;j<C;j++)
fscanf(fp,"%f",&m1[i][j]);
for(i=0;i<R;i++){
for(j=0;j<C;j++)
printf("%6.1f",m1[i][j]);
printf("\n");
}
/*Alloco una seconda matrice di reali delle stesse dimensioni*/
float **m2;
m2=(float**)malloc(sizeof(float*)*R);
for(i=0;i<R;i++)
m2[i]=(float*)malloc(sizeof(float)*C);
/*Pongo nell'elemento i,j della seconda matrice la somma di tutta la riga i
e di tutta la colonna j della prima matrice*/

/*r, e c sono 2 vettori in cui pongo la somma dellle righe e colonne */
float *r,
*c;
r=(float*)malloc(sizeof(float)*R);
c=(float*)malloc(sizeof(float)*C);

for(i=0;i<R;i++){
r[i]=0;
for(j=0;j<C;j++)
r[i]+=m1[i][j];
printf("r %8.1f \n", r[i]);
}

for(j=0;j<C;j++){
c[j]=0;
for(i=0;i<R;i++)
c[j]+=m1[i][j];
printf("c %8.1f \n", c[j]);
}

for(i=0;i<R;i++)
for(j=0;j<C;j++)
m2[i][j]=r[i]+c[j];
FILE *fo;
fo=fopen("destinazione.txt","w");

for(i=0;i<R;i++){
for(j=0;j<C;j++)
fprintf(fo,"%6.1f",m2[i][j]);
fprintf(fo,"\n");
}
/*Chiudo i file e libero la memoria*/
fclose(fp);
fclose(fo);
for(i=0;i<R;i++)
free(m1[i]);
free(m2[i]);
free(r);
free(c);
free(m1);
free(m2);
}



Dec 11 '05 #1
14 3765
vittorio <vi****@SPAM-tin.it> wrote in
news:43***********************@reader3.news.tin.it :
While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with
lcc-win32 under windows xp pro. In fact, under wedit, I can smoothly
compile the program but when I try to execute it it ends with an
"abnormal termination" and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce


<code snipped>

Please indent properly and consistently, and use some extra whitespace.

I see no error-checking for the fopen, fscanf, and malloc calls.

There are quite a few extra-ugly casts floating around.

I would first see what fscanf returns, and whether R and C contain what
you thought they should.

Sinan

--
A. Sinan Unur <1u**@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
Dec 11 '05 #2
A. Sinan Unur wrote:
vittorio <vi****@SPAM-tin.it> wrote in
news:43***********************@reader3.news.tin.it :
While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with
lcc-win32 under windows xp pro. In fact, under wedit, I can smoothly
compile the program but when I try to execute it it ends with an
"abnormal termination" and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce


<code snipped>

Please indent properly and consistently, and use some extra whitespace.

I see no error-checking for the fopen, fscanf, and malloc calls.

There are quite a few extra-ugly casts floating around.

I would first see what fscanf returns, and whether R and C contain what
you thought they should.

Sinan

Sinan,
as I said even shortening the program at the line
"fscanf(fp,"%d%d",&R,&C);" lcc-win32 compiles smoothly but don't exewcute
it giving the same lcc runtime exception. Therefore, No way to check what R
& C are like. While - I repeat under freebsd no problems!

By the way a lessical question: what do you exactly mean with "...There are
quite a few extra-ugly casts floating around...": what are extra-ugly
casts?

Ciao
Vittorio
Dec 11 '05 #3
vittorio <vi****@SPAM-tin.it> wrote in
news:43**********************@reader4.news.tin.it:
A. Sinan Unur wrote:
vittorio <vi****@SPAM-tin.it> wrote in
news:43***********************@reader3.news.tin.it :
While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with
lcc-win32 under windows xp pro. In fact, under wedit, I can smoothly
compile the program but when I try to execute it it ends with an
"abnormal termination" and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce
<code snipped>

Please indent properly and consistently, and use some extra
whitespace.

I see no error-checking for the fopen, fscanf, and malloc calls.

There are quite a few extra-ugly casts floating around.

I would first see what fscanf returns, and whether R and C contain
what you thought they should.

Sinan

Sinan,
as I said even shortening the program at the line
"fscanf(fp,"%d%d",&R,&C);" lcc-win32 compiles smoothly but don't
exewcute it giving the same lcc runtime exception.


Then please provide the shortest possible code that we can compile by
just copying and pasting, along with sample input.
By the way a lessical question: what do you exactly mean with
"...There are quite a few extra-ugly casts floating around...": what
are extra-ugly casts?


The following is an ugly cast:

#include <stdlib.h>

....

float **m1;
m1=(float**)malloc(sizeof(float*)*R);

The cast (float**) is not needed. It clutters the code, and if you ever
did forget to include stdlib.h, you would not get a warning.

From what I can surmise, the recommended replacement for the above is:

float **m1 = malloc(R * sizeof(*m1));

which is far less error prone, and if you ever changed the type of m1,
you only need to do it in one place. (BTW, why aren't you using
doubles?)

Sinan
--
A. Sinan Unur <1u**@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html

Dec 11 '05 #4
vittorio wrote:
for(i=0;i<R;i++)
free(m1[i]);
free(m2[i]);


You try to free m2[R]. But m2 only has valid indices 0 ... (R-1).
This might be what's crashing your program.
I think you meant to write:

for (i = 0; i < R; ++i)
{
free(m1[i]);
free(m2[i]);
}

Also, do not cast the value returned by malloc.
It gains you nothing, and can be a source of errors.

Dec 11 '05 #5
A. Sinan Unur wrote:
vittorio <vi****@SPAM-tin.it> wrote in
news:43**********************@reader4.news.tin.it:
A. Sinan Unur wrote:
vittorio <vi****@SPAM-tin.it> wrote in
news:43***********************@reader3.news.tin.it :

While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with
lcc-win32 under windows xp pro. In fact, under wedit, I can smoothly
compile the program but when I try to execute it it ends with an
"abnormal termination" and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce

<code snipped>

Please indent properly and consistently, and use some extra
whitespace.

I see no error-checking for the fopen, fscanf, and malloc calls.

There are quite a few extra-ugly casts floating around.

I would first see what fscanf returns, and whether R and C contain
what you thought they should.

Sinan

Sinan,
as I said even shortening the program at the line
"fscanf(fp,"%d%d",&R,&C);" lcc-win32 compiles smoothly but don't
exewcute it giving the same lcc runtime exception.


Then please provide the shortest possible code that we can compile by
just copying and pasting, along with sample input.
By the way a lessical question: what do you exactly mean with
"...There are quite a few extra-ugly casts floating around...": what
are extra-ugly casts?


The following is an ugly cast:

#include <stdlib.h>

...

float **m1;
m1=(float**)malloc(sizeof(float*)*R);

The cast (float**) is not needed. It clutters the code, and if you ever
did forget to include stdlib.h, you would not get a warning.

From what I can surmise, the recommended replacement for the above is:

float **m1 = malloc(R * sizeof(*m1));

which is far less error prone, and if you ever changed the type of m1,
you only need to do it in one place. (BTW, why aren't you using
doubles?)


Here you are a working-under-nix extract of the same long code I sent to
this NG causing the same error under lcc-win32 XP pro:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce

At the end the 3 lines of the file matrice.txt

Many thanks for your help
Vittorio
================================================== =0
#include <stdio.h>
#include <stdlib.h>
void main(void){
int i,j;
int R,C;

/*Leggo matrice.txt,trasferendo i valori in una matrice m1 di reali
allocata dinamicamente*/
FILE *fp;
fp=fopen("matrice.txt","r");
fscanf(fp,"%d%d",&R,&C);

float **m1;
m1=(float**)malloc(sizeof(float*)*R);
for(i=0;i<R;i++)
m1[i]=(float*)malloc(sizeof(float)*C);

for(i=0;i<R;i++)
for(j=0;j<C;j++)
fscanf(fp,"%f",&m1[i][j]);
for(i=0;i<R;i++){
for(j=0;j<C;j++)
printf("%6.1f",m1[i][j]);
printf("\n");
}
fclose(fp);
}
================================================== ==
matrice.txt
2 3
98.5 07.1 -2.3
86.5 -9.6 -8.4
Dec 11 '05 #6
vittorio <vi****@SPAM-tin.it> wrote in
news:43***********************@reader2.news.tin.it :
A. Sinan Unur wrote:
Then please provide the shortest possible code that we can compile by
just copying and pasting, along with sample input.

.... Here you are a working-under-nix extract of the same long code I sent
to this NG causing the same error under lcc-win32 XP pro:
I edited your code a little:

#include <stdio.h>
#include <stdlib.h>

int main(void){
int i,j;
int R,C;

float **m1;

FILE *fp;
fp = fopen("matrice.txt","r");
if ( !fp ) {
fprintf(stderr, "Cannot open matrice.txt\n");
exit(EXIT_FAILURE);
}
if ( 2 != fscanf(fp, "%d%d", &R, &C) ) {
fprintf(stderr, "Cannot read dimensions\n");
exit(EXIT_FAILURE);
}

printf("Rows: %d\tColumns: %d\n", R, C);

m1 = malloc(R * sizeof(*m1));
if ( !m1 ) {
fprintf(stderr, "Cannot allocate memory: Line: %d\n", __LINE__);
exit(EXIT_FAILURE);
}

for ( i = 0; i < R; i++ ) {
m1[i] = malloc(C * sizeof(*m1[i]));
if ( !m1[i] ) {
fprintf(stderr, "Cannot allocate memory: Line: %d\n",
__LINE__);
exit(EXIT_FAILURE);
}
}

for ( i = 0; i < R; i++ ) {
for ( j = 0; j < C; j++ ) {
fscanf(fp, "%f", &m1[i][j]);
}
}

for ( i = 0; i < R; i++ ) {
for ( j = 0; j < C; j++ ) {
printf("%6.1f", m1[i][j]);
printf("\n");
}
fclose(fp);
}

return 0;
}

and ran it with the file you supplied:
matrice.txt
2 3
98.5 07.1 -2.3
86.5 -9.6 -8.4


Running on Win XP SP2 after compiling with lcc:

Rows: 2 Columns: 3
98.5
7.1
-2.3
86.5
-9.6
-8.4

"d:\home\asu1\usenet\clc\lcc\m1.exe"
Return code 0
Execution time 0.032 seconds
Press any key to continue...

I'll repeat: Add some error checking to your code.

--
A. Sinan Unur <1u**@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
Dec 11 '05 #7
On Sun, 11 Dec 2005 22:08:58 +0000, in comp.lang.c , vittorio
<vi****@SPAM-tin.it> wrote:
Here you are a working-under-nix extract of the same long code I sent to
this NG causing the same error under lcc-win32 XP pro:
Please turn up warnings in your compiler.
#include <stdio.h>
#include <stdlib.h>
void main(void){
illegal declaration of main, which must return an int.
int i,j;
int R,C;

/*Leggo matrice.txt,trasferendo i valori in una matrice m1 di reali
allocata dinamicamente*/
FILE *fp;
fp=fopen("matrice.txt","r");
did this call succeed? You should check. This is a very possible
cause - I wonder where lcc-win32 creates its debug executables, in a
subdirectory maybe?
fscanf(fp,"%d%d",&R,&C);

float **m1;
Unless you have a very new compiler, you can't declare variables after
executable statements. I don't know if lcc-win32 suupports this/
m1=(float**)malloc(sizeof(float*)*R);
the cast is not required, and it is strongly recommended you do NOT
include it. Ben Pfaff has an excellent explanation of why on his
website. By the way, if your compiler complains about needing the
cast, its a C++ compiler.
for(i=0;i<R;i++)
m1[i]=(float*)malloc(sizeof(float)*C);

for(i=0;i<R;i++)
for(j=0;j<C;j++)
fscanf(fp,"%f",&m1[i][j]);
missing indentation. Not critical, but confusing. I strongly recommend
braces, even for one-liners.
for(i=0;i<R;i++){
for(j=0;j<C;j++)
printf("%6.1f",m1[i][j]);
printf("\n");
}
fclose(fp);
}


This code works correctly, once the problems mentioned above are
fixed.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dec 11 '05 #8
vittorio a écrit :
While I can compile the program below under freebsd via a simple:
gcc prog1.c -o prog1
and it runs smoothly, I'm experiencing annoying problems with lcc-win32
under windows xp pro. In fact, under wedit, I can smoothly compile the
program but when I try to execute it it ends with an "abnormal termination"
and a popup complains that:

lcc runtime
Exception 0xc0000005
segment violation
address 0x73d115ce

The weirdness is greater if you think that cutting many lines of the program
and stopping the execution imediatedly after the line
fscanf(fp,"%d%d",&R,&C);

lcc-win32 chokes on the same exception.


You don't test the return of fopen(). Anything can happen.

You code is full of useless cast but important things like error
checking is totally missing.

This works fine to me (I'm using Code::Blocks)

#include <stdio.h>
#include <stdlib.h>
#define FNAME "matrice.txt"

int main(void)
{
FILE *fp = fopen(FNAME, "r");

if (fp != NULL)
{
int R, C;

int err = fscanf(fp, "%d%d", &R, &C) != 2;

if (!err)
{
float **m1 = malloc (sizeof * m1 * R);

printf ("creating a %d x %d matrix\n", R, C);

if (m1 != NULL)
{
{
int i;
for (i = 0; i < R; i++)
{
m1[i] = malloc(sizeof * m1[i] * C);
err = m1[i] == NULL;
}
}

if (!err)
{
{
int i;
for (i = 0;i < R && !err;i++)
{
int j;
for (j = 0;j < C && !err;j++)
{
int n = fscanf(fp, "%f", &m1[i][j]);

err = n != 1;
}
}
}

if (!err)
{
printf ("%d x %d matrix created\n", R, C);
{
int i;
for (i = 0;i < R;i++)
{
int j;
for (j = 0;j < C;j++)
{
printf("%6.1f", m1[i][j]);
}
printf("\n");
}
}

{
float **m2 = malloc(sizeof * m2 * R);

if (m2 != NULL)
{
{
int i;
for (i = 0;i < R;i++)
{
m2[i] = malloc(sizeof * m2[i] * C);

err = m2[i] == NULL;
}
}

if (!err)
{
float *r = malloc(sizeof * r * R);

if (r != NULL)
{
float *c = malloc(sizeof * c * C);

if (c != NULL)
{
{
int i;
for (i = 0;i < R;i++)
{
int j;
r[i] = 0;
for (j = 0;j < C;j++)
{
r[i] += m1[i][j];
}
printf("r %8.1f \n", r[i]);
}
}

{
int j;
for (j = 0;j < C;j++)
{
int i;
c[j] = 0;
for (i = 0;i < R;i++)
{
c[j] += m1[i][j];
}
printf("c %8.1f \n", c[j]);
}
}

{
int i;
for (i = 0;i < R;i++)
{
int j;
for (j = 0;j < C;j++)
{
m2[i][j] = r[i] + c[j];
}
}
}

{
FILE *fo =
fopen("destinazione.txt", "w");

if (fo != NULL)
{
int i;
for (i = 0;i < R;i++)
{
int j;
for (j = 0;j < C;j++)
{
fprintf(fo, "%6.1f",
m2[i][j]);
}
fprintf(fo, "\n");
}

fclose(fo);
}
}
free(c), c = NULL;
}
free(r), r = NULL;
}

}

{
int i;
for (i = 0;i < R;i++)
{
free(m2[i]);
}
}
free(m2);
printf ("matrix m2 freed\n");
}
}
}
else
{
printf ("input error (data)\n");
}

{
int i;
for (i = 0;i < R;i++)
{
free(m1[i]);
}
}
}

free(m1), m1 = NULL;
printf ("matrix m1 freed\n");
}
}
else
{
printf ("input error (R,C)\n");
}
fclose(fp), fp = NULL;
}
else
{
perror(FNAME);
}

return 0;
}

The input file:

2 3
1 2 3
4 5 6

produces:

11.0 13.0 15.0
20.0 22.0 24.0

The standard output:

creating a 2 x 3 matrix
2 x 3 matrix created
1.0 2.0 3.0
4.0 5.0 6.0
r 6.0
r 15.0
c 5.0
c 7.0
c 9.0
matrix m2 freed
matrix m1 freed
Note : As you can see, due to an intense refactoring based on a dramatic
reducing of the variables scopes, the code has been prepared to be
modularized. You really should learn how to write functions, instead of
repeating the same things... It's boring...

--
A+

Emmanuel Delahaye
Dec 12 '05 #9
Mark McIntyre a écrit :
On Sun, 11 Dec 2005 22:08:58 +0000, in comp.lang.c , vittorio
<vi****@SPAM-tin.it> wrote:

Here you are a working-under-nix extract of the same long code I sent to
this NG causing the same error under lcc-win32 XP pro:

Please turn up warnings in your compiler.

#include <stdio.h>
#include <stdlib.h>
void main(void){

illegal declaration of main, which must return an int.

int i,j;
int R,C;

/*Leggo matrice.txt,trasferendo i valori in una matrice m1 di reali
allocata dinamicamente*/
FILE *fp;
fp=fopen("matrice.txt","r");

did this call succeed? You should check. This is a very possible
cause - I wonder where lcc-win32 creates its debug executables, in a
subdirectory maybe?

fscanf(fp,"%d%d",&R,&C);

float **m1;

Unless you have a very new compiler, you can't declare variables after
executable statements. I don't know if lcc-win32 suupports this/


This is standard C. lcc-win32 supports it.
Declaring variables anywhere is supported since at least 2 years now.

jacob
Dec 12 '05 #10
jacob navia <ja***@jacob.remcomp.fr> writes:
Mark McIntyre a écrit :

[...]
Unless you have a very new compiler, you can't declare variables
after
executable statements. I don't know if lcc-win32 suupports this/


This is standard C. lcc-win32 supports it.
Declaring variables anywhere is supported since at least 2 years now.


Yes, this is standard C. The current C standard is C99.
Unfortunately, the current standard is not (yet?) as widely supported
as the previous one, C90. Mixing declarations and statements can
still cause portability problems if you care about platforms that
don't have C99 compilers (or at least C90 compilers that support
mixing declarations and statements as an extension).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 12 '05 #11
Keith Thompson a écrit :
jacob navia <ja***@jacob.remcomp.fr> writes:
Mark McIntyre a écrit :


[...]
Unless you have a very new compiler, you can't declare variables
after
executable statements. I don't know if lcc-win32 suupports this/


This is standard C. lcc-win32 supports it.
Declaring variables anywhere is supported since at least 2 years now.

Yes, this is standard C. The current C standard is C99.
Unfortunately, the current standard is not (yet?) as widely supported
as the previous one, C90. Mixing declarations and statements can
still cause portability problems if you care about platforms that
don't have C99 compilers (or at least C90 compilers that support
mixing declarations and statements as an extension).


I know Keith, but you will
NOT
have any of those problems using lcc-win32 !!! (:-)

I care about standards and implemented that quite a
while ago.

jacob
Dec 12 '05 #12
On Mon, 12 Dec 2005 12:26:37 +0100, in comp.lang.c , jacob navia
<ja***@jacob.remcomp.fr> wrote:
Mark McIntyre a écrit :
Unless you have a very new compiler, you can't declare variables after
executable statements. I don't know if lcc-win32 suupports this/


This is standard C. lcc-win32 supports it.
Declaring variables anywhere is supported since at least 2 years now.


Fair enough. Still a risky habit to get into, if one ever uses a
different compiler.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dec 12 '05 #13
jacob navia <ja***@jacob.remcomp.fr> writes:
Keith Thompson a écrit :
jacob navia <ja***@jacob.remcomp.fr> writes:
Mark McIntyre a écrit : [...]
Unless you have a very new compiler, you can't declare variables
after
executable statements. I don't know if lcc-win32 suupports this/

This is standard C. lcc-win32 supports it.
Declaring variables anywhere is supported since at least 2 years now.

Yes, this is standard C. The current C standard is C99.
Unfortunately, the current standard is not (yet?) as widely supported
as the previous one, C90. Mixing declarations and statements can
still cause portability problems if you care about platforms that
don't have C99 compilers (or at least C90 compilers that support
mixing declarations and statements as an extension).


I know Keith, but you will
NOT
have any of those problems using lcc-win32 !!! (:-)


Yes, jacob, we know that.

I do have one major problem with lcc-win32: it only works in a single
environment. Others may find it useful in spite of that. I don't.
I care about standards and implemented that quite a
while ago.


Great, but in the real world many of us still have to deal with
pre-C99 implementations, and it would be foolish to ignore that fact.

Fortunately that particular C99 feature, though it's nice to have, is
not essential. It's easy enough to restructure your code so that all
the declarations precede all the statements in each block. The
resulting code (assuming no other problems) is legal in both C90 and
C99.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 12 '05 #14
Thanks for the complete re-editing of my original program.
You're right: I must learn to use more functions in programming and
master many other techniques. But you know, programming isn't only a
science is mainly an art to be learnt step by step from other artists!
Thank you indeed
Vittorio

Dec 13 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Zeng Dinghao | last post by:
could anybody explain the term "in memory compilation" to me ? thanks
51
by: jacob navia | last post by:
After a user asked for clarification about some warnings issued by lcc-win, I have updated the compiler to reflect this discussion. 1) The buggy warning about long l; printf("%li", l * 10L);...
1
by: jacob navia | last post by:
The lcc-win compiler has been ported to the Linux OS. The package is available at: http://www.q-software-solutions.de/products/lcc-linux32/index.shtml There are some problems still with this...
91
by: Eddie | last post by:
Hi I am using lcc-win on Windows 98. I'm writing a simple c console app, and I need to set the background color to blue. Here's the code I've got at the moment: _asm ( "movb $2, %ah\n" "movb...
2
by: jacob navia | last post by:
Preview: lcc-win 64 bits has had a long development period, and is not complete yet. But a preview of the software will be available with the professional version of lcc-win. It features: o...
42
by: jacob navia | last post by:
Within the context of the lcc-win experimental compiler a complete str_ing library is available that uses operator overloading and overloaded functions to present a new type of string library in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.