473,403 Members | 2,354 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,403 software developers and data experts.

strange behaviour

Hi,

via fgets() i create a array containing a text file.

fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
when i want to print it
while (i < w){
//printf("%c", bodytext[i]);
i++;
}
it works, but if i intergrate a if(line[i]=='\\') {...}
it print me some funny caracteres in the text

what happened ?
Oct 15 '06 #1
23 2090
Ico
gribouille <lo****@boursomail.comwrote:
via fgets() i create a array containing a text file.

fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
I see no fgets() in this snippet of code
when i want to print it
while (i < w){
//printf("%c", bodytext[i]);
i++;
}
This does not print anything, since the line containing printf() is
commented out.
it works, but if i intergrate a if(line[i]=='\\') {...}
it print me some funny caracteres in the text
Your code is incoherent, does not match your description and does not
compile. Please provide a complete and compiling program showing the
behaviour you see.
what happened ?
I can't tell from this description. Maybe others can.

--
:wq
^X^Cy^K^X^C^C^C^C
Oct 15 '06 #2
may be this one is better ...
FILE *fp;
line = (char *)malloc(2*sizeof(char));
bodytext = (char *)malloc(sizeof(char));
docwidth = (char *)malloc(sizeof(char));
//tag = (char *)malloc(sizeof(strlen(line)));

fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
allocation_memory(1); // realloc function
//printf("%c", line[l]);
l++;
}
fclose(fp);

i=0;
w = strlen(bodytext);
while (i < w){
printf("%c", bodytext[i]);
i++;
}

realloc funtcion

if ((line = realloc(line, sizeOfLine))) {
/* realoc ok */
sizeOfLine = sizeOfLine++;
} else {

printf ("*** No Memory\n");
exit (1);
free (line);
}

// so if i put the condition in the while loop, it display some wierds
caractere
Oct 15 '06 #3
Ico
gribouille <lo****@boursomail.comwrote:
may be this one is better ...
No, I don't mean to be picky, but it is not better. It still is not
complete and it still does not compile. Please provide a *complete* C
program which people can feed to their compiler without having to guess
what you mean from your snippets. Complete C programs #include the
headers they need, and provide at least a main() function.

[snipped code]

--
:wq
^X^Cy^K^X^C^C^C^C
Oct 15 '06 #4
this one is complete and compile, sorry about that i'm new on this forum ;-)

to test it just put text file in the commande line.
So it works well if i don't put the line
if (line[i] == '\\'){ printf("hello");}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
char *line;
void allocation_memory(int);

int main(int argc, char *argv[]){

line = (char *)malloc(2*sizeof(char));
char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
allocation_memory(1);
l++;
}
fclose(fp);

i=0;
w = strlen(line);
while (i < w){
if (line[i] == '\\'){
printf("hello");
}
printf("%c", line[i]);
i++;
}
free(line);
}

void allocation_memory(int grade)
{

int sizeOfLine = 3;
int sizeOfbodytext = 2;
int sizeOfdocwidth = 2;
switch( grade )
{
case '1' : if ((line = realloc(line, sizeOfLine))) {
/* la réallocation s'est bien passée , l'affectation est
sûre: */
sizeOfLine = sizeOfLine++;
} else {

printf ("*** Mémoire insuffisante\n");
exit (1);
free (line);
}
// return NULL;
break;

}
}
Oct 15 '06 #5
Lots of things wrong with your code!
line = (char *)malloc(2*sizeof(char));
char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r"); // you don't check to see if the fopen worked
while ((c = fgetc(fp)) != EOF) {
line[l] = c; // the letter "ell" is a poor name for a variable, looks too much line the digit "1"
allocation_memory(1); // reallocating a byte at a time is ridiculously slow
l++;
}
fclose(fp);
i=0;
w = strlen(line); // you never put a terminating zero byte into line??
while (i < w){
if (line[i] == '\\'){
printf("hello");
}
printf("%c", line[i]);
i++;
}
void allocation_memory(int grade)
{

int sizeOfLine = 3; // this gets done EVERY time you call this function!
int sizeOfbodytext = 2;
int sizeOfdocwidth = 2;
switch( grade )
{
case '1' : if ((line = realloc(line, sizeOfLine))) {
/* la réallocation s'est bien passée , l'affectation est
sûre: */
sizeOfLine = sizeOfLine++; // useless, and redundant at the same time.
} else {

printf ("*** Mémoire insuffisante\n");
exit (1);
free (line);
}
// return NULL;
break;

}
}
--------------

I suggest you change your memory allocation scheme to get the size of
the file first, then do just one malloc() to get that much memory.

Oct 15 '06 #6
i won' t get the size till the end of the file, is there another way of
getting it ?

Ancient_Hacker a écrit :
Lots of things wrong with your code!
>line = (char *)malloc(2*sizeof(char));
char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r"); // you don't check to see if the fopen worked
> while ((c = fgetc(fp)) != EOF) {
line[l] = c; // the letter "ell" is a poor name for a variable, looks too much line the digit "1"
allocation_memory(1); // reallocating a byte at a time is ridiculously slow
l++;
}
fclose(fp);

>i=0;
>w = strlen(line); // you never put a terminating zero byte into line??
while (i < w){
if (line[i] == '\\'){
printf("hello");
}
>printf("%c", line[i]);
i++;
}

>void allocation_memory(int grade)
{

int sizeOfLine = 3; // this gets done EVERY time you call this function!
int sizeOfbodytext = 2;
int sizeOfdocwidth = 2;
switch( grade )
{
case '1' : if ((line = realloc(line, sizeOfLine))) {
/* la réallocation s'est bien passée , l'affectation est
sûre: */
sizeOfLine = sizeOfLine++; // useless, and redundant at the same time.
} else {

printf ("*** Mémoire insuffisante\n");
exit (1);
free (line);
}
// return NULL;
break;

}
}

--------------

I suggest you change your memory allocation scheme to get the size of
the file first, then do just one malloc() to get that much memory.
Oct 15 '06 #7
gribouille wrote:
>
i won' t get the size till the end of the file, is there another way of
getting it ?
Don't top-post. Your answer belongs after the /snipped/ material
you quote (or possibly intermixed). The snipping removes any
quotes not relevant to your reply.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Oct 15 '06 #8
Ico
gribouille <lo****@boursomail.comwrote:
this one is complete and compile, sorry about that i'm new on this
forum ;-)
No problem, but you'll see people are much more eager to help you when
you post some code that is complete and actually runs.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
char *line;
void allocation_memory(int);

int main(int argc, char *argv[]){

line = (char *)malloc(2*sizeof(char));
Hint: No need to cast the return value of malloc.
char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r");
Hint: You use argv[1] here, without checking if there are actually
additional arguments supplied to the program. Might crash.

Hint: You don't check the value of fp after the fopen call. This causes
undefined behaviour when you use the variable. Might crash.
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
allocation_memory(1);
l++;
}
fclose(fp);

i=0;
w = strlen(line);
This is very wrong: you are using strlen to find out the length of the
string, but your buffer of characters is not terminated by a '\0', which
does not make it a valid C-string. the strlen function is very likely to
return a value that is larger then the number of characters you have
allocated previously, thus your code is reading memory you do not own.
The fix would be to make sure the last character in your string is
always a '\0'
while (i < w){
if (line[i] == '\\'){
printf("hello");
}
printf("%c", line[i]);
i++;
}
free(line);
Hint: main() should return and int
}

void allocation_memory(int grade)
{

int sizeOfLine = 3;
int sizeOfbodytext = 2;
int sizeOfdocwidth = 2;
switch( grade )
{
case '1' : if ((line = realloc(line, sizeOfLine))) {
/* la réallocation s'est bien passée , l'affectation est
sûre: */
sizeOfLine = sizeOfLine++;
This line yields undefined behaviour, the proper syntax is either
"sizeOfLine = sizeOfLine + 1;" or "sizeOfLine ++;"
} else {

printf ("*** Mémoire insuffisante\n");
exit (1);
free (line);
}
// return NULL;
break;

}
}
There might be more problems with this code I, but these ones I spotted
in the first seconds.
--
:wq
^X^Cy^K^X^C^C^C^C
Oct 15 '06 #9
"Ancient_Hacker" <gr**@comcast.netwrites:
Lots of things wrong with your code!
>line = (char *)malloc(2*sizeof(char));
char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r"); // you don't check to see if the fopen worked
> while ((c = fgetc(fp)) != EOF) {
line[l] = c; // the letter "ell" is a poor name for a variable, looks too much line the digit "1"
allocation_memory(1); // reallocating a byte at a time is ridiculously slow
[snip]

If you're going to comment on code, please write your comments
separately, as new text, not as actual comments added to the code.
It's impossible to tell, without going back to the previous article,
whether your comments were in the originally posted code or not.

And "//" comments on Usenet are ill-advised, especially with very long
lines.

--
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.
Oct 15 '06 #10
On Sun, 2006-10-15 at 19:31 +1000, gribouille wrote:
may be this one is better ...
Hardly. You need to post something /compilable/.
>
FILE *fp;
line = (char *)malloc(2*sizeof(char));
Four things:
1) Never case the return value of malloc(). It hides the fact that you
didn't #include <stdlib.h>.
2) Never use sizeof on a type name, at least at this point in your C
programming. Use (sizeof *line) if you must.
3) sizeof(char) is 1 by definition. You can eliminate it, thus improving
clarity.
4) Don't use tabs on Usenets. They'll display wrong, be filtered out, or
display correctly. In any case, it's bad. Use 2 or 4 spaces instead.

So,
line = malloc(2);

See how much nicer that is?
bodytext = (char *)malloc(sizeof(char));
docwidth = (char *)malloc(sizeof(char));
//tag = (char *)malloc(sizeof(strlen(line)));
Two things:
1) // comments aren't supported in C90, which is what 99.9% of people
use. Use /*...*/ comments instead.
2) sizeof(strlen(line)) == sizeof (size_t), probably not what you want.
>
fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
allocation_memory(1); // realloc function
//printf("%c", line[l]);
l++;
}
What does that brace close? Please format correctly.

<snipped other unreadable code>

Fix your formatting and the aforementioned problems, and then we'll be
able to fix all the UB and logic errors in your code.

--
Andrew Poelstra <http://www.wpsoftware.net>
For email, use 'apoelstra' at the above site.

Oct 15 '06 #11
Andrew Poelstra wrote:
On Sun, 2006-10-15 at 19:31 +1000, gribouille wrote:
>>may be this one is better ...


Hardly. You need to post something /compilable/.

>>FILE *fp;
line = (char *)malloc(2*sizeof(char));


Four things:
1) Never case the return value of malloc(). It hides the fact that you
didn't #include <stdlib.h>.
2) Never use sizeof on a type name, at least at this point in your C
programming. Use (sizeof *line) if you must.
Why? I heard people prefer "sizeof *var" because it's nicer or whatever,
but why "Never use sizeof on a type name"? Is it really such an advanced
thing, and only mature programmers can use it correctly?

Regards,
Yevgen
Oct 15 '06 #12
Yevgen Muntyan wrote:
Andrew Poelstra wrote:
On Sun, 2006-10-15 at 19:31 +1000, gribouille wrote:
2) Never use sizeof on a type name, at least at this point in your C
programming. Use (sizeof *line) if you must.

Why? I heard people prefer "sizeof *var" because it's nicer or whatever,
but why "Never use sizeof on a type name"? Is it really such an advanced
thing, and only mature programmers can use it correctly?
The reason is that you should factor out every variable aspect of your
program so that it appears only in one place.

Suppose you have:

int* var;

var = malloc(n * sizeof(int));

Now, if you want to change the type of 'var', for example, to long you
need to change it in two places. On the other hand:

int* var;

var = malloc(n * sizeof *var);

Here you only need to change the declaration.
Regards,
Bart.

Oct 15 '06 #13
On Sun, 2006-10-15 at 18:52 +0000, Yevgen Muntyan wrote:
Andrew Poelstra wrote:
2) Never use sizeof on a type name, at least at this point in your C
programming. Use (sizeof *line) if you must.

Why? I heard people prefer "sizeof *var" because it's nicer or whatever,
but why "Never use sizeof on a type name"? Is it really such an advanced
thing, and only mature programmers can use it correctly?
It's a cautious way to program; in almost all cases using sizeof on an
object instead of a type will cause no problems, and will protect the
code against future changes.

It could be considered a style issue, I suppose, but I think that it's
more than that.

As for sizeof(type), it's only really necessary in a few very special
situations which may be considered advanced.

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>

Oct 15 '06 #14
Yevgen Muntyan <mu****************@tamu.eduwrites:
Andrew Poelstra wrote:
>On Sun, 2006-10-15 at 19:31 +1000, gribouille wrote:
>>>may be this one is better ...
Hardly. You need to post something /compilable/.
>>>FILE *fp;
line = (char *)malloc(2*sizeof(char));
Four things:
1) Never case the return value of malloc(). It hides the fact that you
didn't #include <stdlib.h>.
2) Never use sizeof on a type name, at least at this point in your C
programming. Use (sizeof *line) if you must.

Why? I heard people prefer "sizeof *var" because it's nicer or whatever,
but why "Never use sizeof on a type name"? Is it really such an advanced
thing, and only mature programmers can use it correctly?
Think about why you want to compute the size of something. If you
want the size of a type, it's almost always because you need the size
of some object or expression of that type. And if, as the code is
maintained, the type of that object or expression changes, you won't
need to change code if you applied sizeof directly to the object or
expression rather than to the type.

--
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.
Oct 15 '06 #15
In article <45***********************@news.optusnet.com.au>
gribouille <lo****@boursomail.comwrote:
[much snippage]
allocation_memory(1);
[more snippage]
>void allocation_memory(int grade) {
[still more snippage]
switch( grade )
{
case '1' :
Others have pointed out several earlier problems. Another one occurs
here: you pass the integer constant 1 to allocation_memory(), and
then test for the character-constant '1', which is probably 49 or
241 (depending on whether your machine uses ASCII or EBCDIC), but
in any case is definitely not 1.

There is no other "case", and no "default", so the switch statement
falls through to the end, which is also the end of the function, and
the call is a no-op.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Oct 16 '06 #16
gribouille wrote:
i won' t get the size till the end of the file, is there another way of
getting it ?
There certainly is! Use fseek() to set the file pointer to the end of
the file, then ftell() to return the pointer's position. This'll give
you the size of the file. The rewind() function sets the file pointer to
the start of the file again - essential if you're going to read from it.
Finally, instead of reading each byte with fgetc(), you can read an
entire chunk of data with fread().

A snippet, for demonstration:

-------------------------
FILE *fp;
char *myfile;
long filesize;

if(! (fp = fopen(argv[1], "rb")) )
{
// failed to open file
return -1;
}

fseek(fp, 0L, SEEK_END);
filesize = ftell(fp);
rewind(fp);

myfile = (char*)malloc(filesize * sizeof(char));

fread(myfile, filesize, 1, fp);
-------------------------

Note that this example only allocates enough space for the file, not for
a terminating null. You'll need to add that if you're going to display
the file contents as a string, for example.

Good luck!
Oct 16 '06 #17
Chris Torek wrote:
gribouille <lo****@boursomail.comwrote:

[much snippage]
> allocation_memory(1);
[more snippage]
>void allocation_memory(int grade) {
[still more snippage]
> switch( grade )
{
case '1' :

Others have pointed out several earlier problems. Another one
occurs here: you pass the integer constant 1 to allocation_memory(),
and then test for the character-constant '1', which is probably 49
or 241 (depending on whether your machine uses ASCII or EBCDIC), but
in any case is definitely not 1.
I think it is on MIX :-)

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Oct 16 '06 #18
Steven Kirby said:
gribouille wrote:
>i won' t get the size till the end of the file, is there another way of
getting it ?

There certainly is! Use fseek() to set the file pointer to the end of
the file, then ftell() to return the pointer's position. This'll give
you the size of the file.
This technique often works, but strictly speaking it's not a portable
technique, failing for one reason on text streams and for another on binary
streams. The comp.lang.c archives are packed to the gunwales with
discussions of this issue. A Google Groups search may prove informative.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Oct 16 '06 #19
Steven Kirby <pr****************@SPAMgmail.comwrote:
gribouille wrote:
i won' t get the size till the end of the file, is there another way of
getting it ?

There certainly is! Use fseek() to set the file pointer to the end of
the file, then ftell() to return the pointer's position. This'll give
you the size of the file.
Except that it may not. For binary streams fseek() with SEEK_END isn't
required to work, and for text streams ftell() need not give you a count
in bytes, chars, or anything else that makes sense to a human; so either
way, this method may work, but it's not guaranteed.
myfile = (char*)malloc(filesize * sizeof(char));
Oh, and don't cast malloc(). It's not necessary, and all unnecessary
casts are the work of Nyarlathotep; and in fact it may hide the error of
not having a declaration in scope. Also, but less seriously, sizeof
(char) is guaranteed to be 1.

Richard
Oct 16 '06 #20
CBFalconer <cb********@yahoo.comwrites:
Chris Torek wrote:
[...]
>Others have pointed out several earlier problems. Another one
occurs here: you pass the integer constant 1 to allocation_memory(),
and then test for the character-constant '1', which is probably 49
or 241 (depending on whether your machine uses ASCII or EBCDIC), but
in any case is definitely not 1.

I think it is on MIX :-)
I think you're right -- but '1' cannot equal 1 on any conforming C
implementation. (The digits are contiguous, and '\0' is reserved.)
Which means that a conforming C implementation for MIX can't use the
MIX-native character encoding.

--
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.
Oct 16 '06 #21
On Mon, 2006-10-16 at 09:07 +0000, Keith Thompson wrote:
CBFalconer <cb********@yahoo.comwrites:
Chris Torek wrote:
[...]
Others have pointed out several earlier problems. Another one
occurs here: you pass the integer constant 1 to allocation_memory(),
and then test for the character-constant '1', which is probably 49
or 241 (depending on whether your machine uses ASCII or EBCDIC), but
in any case is definitely not 1.
I think it is on MIX :-)

I think you're right -- but '1' cannot equal 1 on any conforming C
implementation. (The digits are contiguous, and '\0' is reserved.)
Which means that a conforming C implementation for MIX can't use the
MIX-native character encoding.
MIX also fails in that it has no lowercase letters. IIRC, it also lacks
some of the spacing and symbol characters that are required.

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>

Oct 16 '06 #22
Andrew Poelstra <ap*******@false.sitewrote:
On Mon, 2006-10-16 at 09:07 +0000, Keith Thompson wrote:
CBFalconer <cb********@yahoo.comwrites:
Chris Torek wrote:
[...]
>Others have pointed out several earlier problems. Another one
>occurs here: you pass the integer constant 1 to allocation_memory(),
>and then test for the character-constant '1', which is probably 49
>or 241 (depending on whether your machine uses ASCII or EBCDIC), but
>in any case is definitely not 1.
>
I think it is on MIX :-)
I think you're right -- but '1' cannot equal 1 on any conforming C
implementation. (The digits are contiguous, and '\0' is reserved.)
Which means that a conforming C implementation for MIX can't use the
MIX-native character encoding.

MIX also fails in that it has no lowercase letters. IIRC, it also lacks
some of the spacing and symbol characters that are required.
Isn't it a pity that MMIX uses ASCII <g>?

Richard
Oct 16 '06 #23
On Sun, 15 Oct 2006 22:03:25 +1000, gribouille <lo****@boursomail.com>
wrote:
>this one is complete and compile, sorry about that i'm new on this forum ;-)

to test it just put text file in the commande line.
So it works well if i don't put the line
if (line[i] == '\\'){ printf("hello");}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
char *line;
void allocation_memory(int);

int main(int argc, char *argv[]){

line = (char *)malloc(2*sizeof(char));
line can hold up to 2 char.
>char c;
int i = 0;
int v = 0;
int l = 0;
int w = 0;

FILE *fp;
fp = fopen(argv[1], "r");
while ((c = fgetc(fp)) != EOF) {
line[l] = c;
allocation_memory(1);
Now line can hold up the 3 char, never any more. Is your data file
that small?
> l++;
Once l reaches 3, you are attempting to overwrite memory you don't
own. This is undefined behavior.
> }
fclose(fp);

i=0;
w = strlen(line);
Is there any reason to believe that you ever stored a '\0' in the
memory line points to
..
>while (i < w){
A for loop is the more common approach here.
>if (line[i] == '\\'){
printf("hello");
}
printf("%c", line[i]);
i++;
}
free(line);
main should return an int.
>}

void allocation_memory(int grade)
{

int sizeOfLine = 3;
Because this is not static, it will always be 3 when this function
starts.
int sizeOfbodytext = 2;
int sizeOfdocwidth = 2;
switch( grade )
{
case '1' : if ((line = realloc(line, sizeOfLine))) {
sizeOfLine is always 3 at this point.
/* la réallocation s'est bien passée , l'affectation est
sûre: */
sizeOfLine = sizeOfLine++;
This invokes undefined behavior. Use either
sizeOfLine++;
or
sizeOfLine += 1;
} else {

printf ("*** Mémoire insuffisante\n");
exit (1);
free (line);
This line can never execute. exit() never returns after it is called.

Even if it did, line now contains NULL and you will not free any
memory.
}
// return NULL;
break;

}
}

Remove del for email
Oct 17 '06 #24

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

Similar topics

0
by: Frank Passek | last post by:
Dear all, I've encountered some strange behaviour with PHP (4.3.2) using the CLI-API. When I provide an option in the first line of my script like so: #!/usr/bin/php -c /path_to_my_ini_file and...
0
by: Phil | last post by:
Hi, I don't understand this strange behaviour: I compile this code : #include <Python.h> #include"Numeric/arrayobject.h" static PyObject *
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
3
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
3
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
31
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
4
by: Gotch | last post by:
Hi, I'm getting a very strange behaviour while running a project I've done.... Let's expose it: I've two projects. Both of them use a Form to do some Gui stuff. Other threads pack up messages...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
20
by: Pilcrow | last post by:
This behavior seems very strange to me, but I imagine that someone will be able to 'explain' it in terms of the famous C standard. -------------------- code -----------------------------------...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.