473,761 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compile Time Error ... arghh

I dont know whats terribly going wrong with this, well I know there's
some memory allocation with this but I tried hard to fix it and when
it gets fixed it doesn't shows up the desired value, this is the code
that shows the compile-time error:

#include <stdio.h>
#include <string.h>

#define $WORD_LIST(X) "resource/" X

typedef struct char_type
{
char** ptr;
}ccarray;

int ccarray_create( ccarray *c)
{
c = (ccarray*)mallo c(sizeof(ccarra y*));

c->ptr = (char**) malloc(sizeof(c har**) * 1024);
return 0;
}

int ccarray_insert( ccarray *c, char* str, int pos)
{
c->ptr[pos] = str;
printf("%d %s\n", pos, c->ptr[pos]);
}

int ccarray_destroy (ccarray *c)
{
free( c->ptr );
free( c );
return 0;
}

int ccarray_read_fi le(ccarray* c, char* filename)
{
FILE * fptr;
char* line;
int i;

fptr = fopen(filename, "r");
line = (char*) malloc(sizeof(c har)*100);
i = 0;

while( fscanf(fptr,"%s ",line) != EOF )
{
ccarray_insert( c, line, i);
i++;
}
free(line);
fclose(fptr);
}

int ccarray_print(c carray* c)
{
int i = 0;
while ( c->ptr[i] != NULL )
{
printf("Line: %s\n", c->ptr[i] );
i++;
}
}

int main()
{
ccarray * c;
ccarray_create( c);
ccarray_read_fi le(c, $WORD_LIST("sam ple.txt"));
ccarray_print(c );
ccarray_destroy (c);
return 0;
}

.... and this thing runs fine but doesn't shows any result:

#include <stdio.h>
#include <string.h>

#define $WORD_LIST(X) "resource/" X

typedef struct char_type
{
char** ptr;
}ccarray;

int ccarray_create( ccarray **c)
{
(*c) = (ccarray*)mallo c(sizeof(ccarra y));
(*c) = (ccarray*)mallo c(sizeof(ccarra y));
(*c)->ptr = (char**) malloc(sizeof(c har**) * 1024);
return 0;
}

int ccarray_insert( ccarray **c, char* str, int pos)
{
(*c)->ptr[pos] = str;
//printf("%s ", (*c)->ptr[pos] );
}

int ccarray_destroy (ccarray **c)
{
free( (*c)->ptr );
free( c );
return 0;
}

int ccarray_read_fi le(ccarray** c, char* filename)
{
FILE * fptr;
char* line;
int i;

fptr = fopen(filename, "r");
line = (char*) malloc(sizeof(c har)*100);
i = 0;

while( fscanf(fptr,"%s ",line) != EOF )
{
ccarray_insert( c, line, i);
i++;
}
free(line);
fclose(fptr);
}

int ccarray_print(c carray** c)
{
int i = 0;
while ( (*c)->ptr[i] != NULL )
{
printf("Line: %s\n", (*c)->ptr[i] );
i++;
}
}

int main()
{
ccarray * c;
ccarray_create( &c);
ccarray_read_fi le(&c, $WORD_LIST("sam ple.txt"));
ccarray_print(& c);
ccarray_destroy (&c);
return 0;
}

Mar 24 '07 #1
9 2094
Fi************@ gmail.com said:
I dont know whats terribly going wrong with this, well I know there's
some memory allocation with this but I tried hard to fix it and when
it gets fixed it doesn't shows up the desired value, this is the code
that shows the compile-time error:

#include <stdio.h>
#include <string.h>

#define $WORD_LIST(X) "resource/" X
Lose the $. If that doesn't do the trick, let us know.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 24 '07 #2
It has no concern with it, but still I removed it and it still doesn't
works.

Mar 24 '07 #3
Fi************@ gmail.com said:
It has no concern with it, but still I removed it and it still doesn't
works.
foo.c:65: warning: `$' in identifier
foo.c:12: warning: no previous prototype for `ccarray_create '
foo.c: In function `ccarray_create ':
foo.c:13: warning: implicit declaration of function `malloc'
foo.c:13: warning: cast does not match function type
foo.c:15: warning: cast does not match function type
foo.c: At top level:
foo.c:20: warning: no previous prototype for `ccarray_insert '
foo.c: In function `ccarray_insert ':
foo.c:23: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:26: warning: no previous prototype for `ccarray_destro y'
foo.c: In function `ccarray_destro y':
foo.c:27: warning: implicit declaration of function `free'
foo.c: At top level:
foo.c:33: warning: no previous prototype for `ccarray_read_f ile'
foo.c: In function `ccarray_read_f ile':
foo.c:39: warning: cast does not match function type
foo.c:49: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:52: warning: no previous prototype for `ccarray_print'
foo.c: In function `ccarray_print' :
foo.c:59: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:62: warning: function declaration isn't a prototype
foo.c: In function `main':
foo.c:65: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from
pointer target type
foo.c:63: warning: `c' might be used uninitialized in this function

Losing the $ and adding <stdlib.h>, we get:

foo.c:13: warning: no previous prototype for `ccarray_create '
foo.c:21: warning: no previous prototype for `ccarray_insert '
foo.c: In function `ccarray_insert ':
foo.c:24: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:27: warning: no previous prototype for `ccarray_destro y'
foo.c:34: warning: no previous prototype for `ccarray_read_f ile'
foo.c: In function `ccarray_read_f ile':
foo.c:50: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:53: warning: no previous prototype for `ccarray_print'
foo.c: In function `ccarray_print' :
foo.c:60: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:63: warning: function declaration isn't a prototype
foo.c: In function `main':
foo.c:66: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from pointer target type
foo.c:64: warning: `c' might be used uninitialized in this function

Adding full prototype info:

foo.c: In function `ccarray_insert ':
foo.c:30: warning: control reaches end of non-void function
foo.c: In function `ccarray_read_f ile':
foo.c:56: warning: control reaches end of non-void function
foo.c: In function `ccarray_print' :
foo.c:66: warning: control reaches end of non-void function
foo.c: In function `main':
foo.c:72: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from pointer target type
foo.c:70: warning: `c' might be used uninitialized in this function
And now we're getting to the real problem. c is indeed used
uninitialised - its (indeterminate) value is copied to ccarray_create.
ccarray_create changes its copy, but to no avail, since the
(indeterminate) value in main is unaffected.

When you want to change an object's value by passing it to a function,
you have to pass the address of that object. Passing the object's value
is pointless.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 24 '07 #4
On Mar 24, 1:46 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
Finger.Octo...@ gmail.com said:
It has no concern with it, but still I removed it and it still doesn't
works.

foo.c:65: warning: `$' in identifier
foo.c:12: warning: no previous prototype for `ccarray_create '
foo.c: In function `ccarray_create ':
foo.c:13: warning: implicit declaration of function `malloc'
foo.c:13: warning: cast does not match function type
foo.c:15: warning: cast does not match function type
foo.c: At top level:
foo.c:20: warning: no previous prototype for `ccarray_insert '
foo.c: In function `ccarray_insert ':
foo.c:23: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:26: warning: no previous prototype for `ccarray_destro y'
foo.c: In function `ccarray_destro y':
foo.c:27: warning: implicit declaration of function `free'
foo.c: At top level:
foo.c:33: warning: no previous prototype for `ccarray_read_f ile'
foo.c: In function `ccarray_read_f ile':
foo.c:39: warning: cast does not match function type
foo.c:49: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:52: warning: no previous prototype for `ccarray_print'
foo.c: In function `ccarray_print' :
foo.c:59: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:62: warning: function declaration isn't a prototype
foo.c: In function `main':
foo.c:65: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from
pointer target type
foo.c:63: warning: `c' might be used uninitialized in this function

Losing the $ and adding <stdlib.h>, we get:

foo.c:13: warning: no previous prototype for `ccarray_create '
foo.c:21: warning: no previous prototype for `ccarray_insert '
foo.c: In function `ccarray_insert ':
foo.c:24: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:27: warning: no previous prototype for `ccarray_destro y'
foo.c:34: warning: no previous prototype for `ccarray_read_f ile'
foo.c: In function `ccarray_read_f ile':
foo.c:50: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:53: warning: no previous prototype for `ccarray_print'
foo.c: In function `ccarray_print' :
foo.c:60: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:63: warning: function declaration isn't a prototype
foo.c: In function `main':
foo.c:66: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from pointer target type
foo.c:64: warning: `c' might be used uninitialized in this function

Adding full prototype info:

foo.c: In function `ccarray_insert ':
foo.c:30: warning: control reaches end of non-void function
foo.c: In function `ccarray_read_f ile':
foo.c:56: warning: control reaches end of non-void function
foo.c: In function `ccarray_print' :
foo.c:66: warning: control reaches end of non-void function
foo.c: In function `main':
foo.c:72: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from pointer target type
foo.c:70: warning: `c' might be used uninitialized in this function

And now we're getting to the real problem. c is indeed used
uninitialised - its (indeterminate) value is copied to ccarray_create.
ccarray_create changes its copy, but to no avail, since the
(indeterminate) value in main is unaffected.

When you want to change an object's value by passing it to a function,
you have to pass the address of that object. Passing the object's value
is pointless.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999http://www.cpax.org.uk
email: rjh at the above domain, - www.

There are two programs above, which one are you talking about?

Mar 24 '07 #5
After some changes, it runs fine but still it doesn't shows anything:

#include <stdio.h>
#include <string.h>

#define WORD_LIST(X) "resource/" X

typedef struct char_type
{
char** ptr;
}ccarray;

ccarray* ccarray_create( )
{
ccarray* c = (ccarray*)mallo c(sizeof(ccarra y));
c->ptr = (char**) malloc(sizeof(c har**) * 1024);
return c;
}

int ccarray_insert( ccarray *c, char* str, int pos)
{
c->ptr[pos] = str;
//printf("%s ", (*c)->ptr[pos] );
}

int ccarray_destroy (ccarray *c)
{
free( c->ptr );
free( c );
return 0;
}

int ccarray_read_fi le(ccarray* c, char* filename)
{
FILE * fptr;
char* line;
int i;

fptr = fopen(filename, "r");
line = (char*) malloc(sizeof(c har)*100);
i = 0;

while( fscanf(fptr,"%s ",line) != EOF )
{
ccarray_insert( c, line, i);
i++;
}
free(line);
fclose(fptr);
}

int ccarray_print(c carray* c)
{
int i = 0;
while ( c->ptr[i] != NULL )
{
printf("Line: %s\n", c->ptr[i] );
i++;
}
}

int main()
{
ccarray * c = ccarray_create( c);
ccarray_read_fi le(c, WORD_LIST("samp le.txt"));
ccarray_print(c );
ccarray_destroy (c);
return 0;
}

Mar 24 '07 #6
The source file sample.txt contains:

EDIT
BLAH
WHATEVER

and, what I get in output of this program is :

Line:
Line:
Line:
It is getting the number of lines for a strange reason but not the
lines themselves.

Mar 24 '07 #7
Fi************@ gmail.com said:
After some changes, it runs fine but still it doesn't shows anything:
For me, however, it doesn't compile. This is hardly surprising, since
you appear to have ignored some of my advice.

foo.c:12: warning: function declaration isn't a prototype
foo.c: In function `ccarray_create ':
foo.c:13: warning: implicit declaration of function `malloc'
foo.c:13: warning: cast does not match function type
foo.c:14: warning: cast does not match function type
foo.c: At top level:
foo.c:19: warning: no previous prototype for `ccarray_insert '
foo.c: In function `ccarray_insert ':
foo.c:21: parse error before `/'
foo.c:22: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:25: warning: no previous prototype for `ccarray_destro y'
foo.c: In function `ccarray_destro y':
foo.c:26: warning: implicit declaration of function `free'
foo.c: At top level:
foo.c:32: warning: no previous prototype for `ccarray_read_f ile'
foo.c: In function `ccarray_read_f ile':
foo.c:38: warning: cast does not match function type
foo.c:48: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:51: warning: no previous prototype for `ccarray_print'
foo.c: In function `ccarray_print' :
foo.c:58: warning: control reaches end of non-void function
foo.c: At top level:
foo.c:61: warning: function declaration isn't a prototype
foo.c: In function `main':
foo.c:63: warning: passing arg 2 of `ccarray_read_f ile' discards
qualifiers from pointer target type
make: *** [foo.o] Error 1

To explain the changes I made, line by line, would be tedious. Note,
however, the significant differences between your program and mine, not
least amongst which is the fact that my version works.

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

#define WORD_LIST(X) "resource/" X
#define INIT_MAX_LINES 1024
#define INIT_LINE_LEN 100

typedef struct char_type
{
char **ptr;
size_t linecount;
size_t maxlines;
} ccarray;

ccarray *ccarray_create (void);
int ccarray_insert( ccarray * c, char *str, size_t pos);
int ccarray_destroy (ccarray * c);
int ccarray_read_fi le(ccarray * c, const char *filename);
int ccarray_print(c carray * c);
char *dupstr(const char *s);

char *dupstr(const char *s)
{
size_t len = strlen(s) + 1;
char *new = malloc(len);
if(new != NULL)
{
memcpy(new, s, len);
}
return new;
}

ccarray *ccarray_create (void)
{
ccarray *c = malloc(sizeof *c);

if(c != NULL)
{
c->ptr = malloc(INIT_MAX _LINES * sizeof *c->ptr);
if(c->ptr == NULL)
{
free(c);
c = NULL;
}
else
{
size_t i = 0;
c->linecount = 0;
c->maxlines = INIT_MAX_LINES;
while(i < c->linecount)
{
c->ptr[i++] = NULL;
}
}
}
return c;
}

int ccarray_insert( ccarray * c, char *str, size_t pos)
{
int rc = 0;
if(pos >= c->maxlines)
{
size_t newsize = (c->maxlines * 2 pos) ?
c->maxlines * 2 : (pos + 1);

char **tmp = realloc(c->ptr, newsize);
if(tmp == NULL)
{
rc = 1;
}
else
{
c->ptr = tmp;
c->maxlines = newsize;
}
}
if(rc == 0)
{
if(pos c->linecount)
{
size_t i = c->linecount;
while(i < pos)
{
c->ptr[i++] = NULL;
}
c->linecount = pos + 1;
}
else if(pos == c->linecount)
{
++c->linecount;
}
c->ptr[pos] = dupstr(str);
if(c->ptr[pos] == NULL)
{
rc = 2;
}
}
return rc;
}

int ccarray_destroy (ccarray * c)
{
size_t i = 0;
while(i < c->linecount)
{
free(c->ptr[i++]);
}
free(c->ptr);
free(c);
return 0;
}

int ccarray_read_fi le(ccarray *c, const char *filename)
{
FILE *fptr;
char *line;
int i;
int rc = 0;

fptr = fopen(filename, "r");
if(fptr != NULL)
{
line = malloc(INIT_LIN E_LEN);
if(line != NULL)
{
char safefmt[32] = {0};
i = 0;

sprintf(safefmt , "%%%ds", INIT_LINE_LEN - 1);
while(rc == 0 && fscanf(fptr, safefmt, line) == 1)
{
rc = ccarray_insert( c, line, i);
i++;
}

free(line);
}
else
{
rc = 4;
}
fclose(fptr);
}
else
{
rc = 3;
}
return rc;
}

int ccarray_print(c carray * c)
{
int i = 0;

while(c->ptr[i] != NULL)
{
printf("Line: %s\n", c->ptr[i]);
i++;
}
return 0;
}

int main(void)
{
int rc = 0;
ccarray *c = ccarray_create( );
if(c != NULL)
{
rc = ccarray_read_fi le(c, WORD_LIST("samp le.txt"));
if(rc != 0)
{
fprintf(stderr, "read failed: %d\n", rc);
}
else
{
ccarray_print(c );
}
ccarray_destroy (c);
}
return 0;
}
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 24 '07 #8
On 24 Mar 2007 02:21:24 -0700, Fi************@ gmail.com wrote:
>After some changes, it runs fine but still it doesn't shows anything:
How can it run fine if it doesn't do what you want.
>
#include <stdio.h>
#include <string.h>
You are missing stdlib.h. All your calls to malloc invoke undefined
behavior.
>
#define WORD_LIST(X) "resource/" X

typedef struct char_type
{
char** ptr;
}ccarray;

ccarray* ccarray_create( )
If your function takes no arguments, you should specify that
ccarray* ccarray_create( void)
>{
ccarray* c = (ccarray*)mallo c(sizeof(ccarra y));
Don't cast the return from malloc. It never helps. In this case, it
caused the compiler to suppress a mandatory diagnostic that would have
led you to include stdlib.h as noted above.
> c->ptr = (char**) malloc(sizeof(c har**) * 1024);
This is the wrong amount of space to allocate. c->ptr is a char**.
Therefore, the object it points to is a char*. If you want to
allocate space for 1024 char*, then you should code
sizeof(char*)*1 024. However, rather than have to keep all the types
straight manually, the following will always yield the correct amount
of space
c->ptr = malloc(1024 * sizeof *c->ptr);
> return c;
}

int ccarray_insert( ccarray *c, char* str, int pos)
{
c->ptr[pos] = str;
//printf("%s ", (*c)->ptr[pos] );
If this weren't a comment it would be a syntax error. c is a pointer
to struct. Therefore *c and (*c) are of type struct. You cannot use
the -operator on a struct, only on a pointer to struct.
>}

int ccarray_destroy (ccarray *c)
{
free( c->ptr );
You got it correct here.
> free( c );
return 0;
}

int ccarray_read_fi le(ccarray* c, char* filename)
{
FILE * fptr;
char* line;
int i;

fptr = fopen(filename, "r");
Did fopen() really open the file? Shouldn't you check?
> line = (char*) malloc(sizeof(c har)*100);
i = 0;

while( fscanf(fptr,"%s ",line) != EOF )
Are you really, really, REALLY sure the input is less than 100
characters?
> {
ccarray_insert( c, line, i);
i++;
Are you sure i will never exceed 1024?

This doesn't do what you want. line is a pointer to a single
allocated area of memory. You scan the first string into that memory.
You call ccarray_insert to store the address of that memory in
c->ptr[0]. You scan the second string into the same memory, replacing
all or part of the first string, and then store the SAME ADDRESS in
c->ptr[1]. When you are all done with this loop, only the last string
is in line and all the elements of c->ptr point to this one string.
> }
free(line);
Now, all the addresses in the elements of c->ptr which used to point
to line are, by definition, indeterminate. They don't point to
anything.
> fclose(fptr);
}

int ccarray_print(c carray* c)
{
int i = 0;
while ( c->ptr[i] != NULL )
Any attempt to evaluate the address in c->ptr[i] invokes undefined
behavior. Furthermore, at no time did you ever put a NULL value in
any c->ptr[i]. Maybe you meant to after the loop in
ccarray_read_fi le.
> {
printf("Line: %s\n", c->ptr[i] );
c->ptr[i] no longer points to a string. More undefined behavior.
> i++;
}
}

int main()
{
ccarray * c = ccarray_create( c);
If you had defined ccarray_create correctly as noted above, this would
have generated a diagnostic saying you should not have an argument. As
it is, it invokes undefined behavior because the variable c has not
been assigned a value at the time the argument is evaluated before
calling the function.
> ccarray_read_fi le(c, WORD_LIST("samp le.txt"));
ccarray_print(c );
ccarray_destroy (c);
return 0;
}

Remove del for email
Mar 24 '07 #9
On 24 Mar 2007 02:21:24 -0700, in comp.lang.c ,
Fi************@ gmail.com wrote:
>After some changes, it runs fine but still it doesn't shows anything:
It doesn't even compile - please turn up your warning levels and fix
the errors you get.
> ccarray* c = (ccarray*)mallo c(sizeof(ccarra y));
Don't cast the return from malloc. It is not required in C, and
sometimes hides a serious error (forgetting to #include stdlib.h) as
well as removing some of the compiler's ability to check your code
properly.

If you did this to get rid of a warning, you made a serious mistake.
If you did it because you usually write C++, then please remember that
C and C++ are different languages.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 24 '07 #10

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

Similar topics

5
3335
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new rightType;
2
4645
by: Glen | last post by:
I'm working on a custom assembly and I'm trying to figure out the best approach to handling known constraints within the assembly, once compiled, to alert the developer at compile time of a potential issue. For example, in the assembly I would like to add a constraint that states a particular property member of the class can not be equal to one other property. In standard coding I can throw an exception during run-time, but I would rather...
13
3071
by: Adam Blair | last post by:
Is it possible to bind a switch statement to an Enum such that a compile-time error is raised if not all values within the Enum are handled in the switch statement? I realise you can use default: to catch unhandled cases, but of course this is only at run-time. Example: public enum MyEnum { one, two, three, four }
8
3876
by: Michael Paesold | last post by:
I just read this in the MySQL manual: (http://dev.mysql.com/doc/mysql/en/InnoDB_Error_handling.html) "Error handling in InnoDB is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause the rollback of that statement. InnoDB sometimes rolls back only part of the statement, or the whole transaction. The following items describe how InnoDB performs error handling:" ...
0
2515
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some of you might have an answer. I would greatly appreciate help with this, as I tried to search for an answer for quite some time in vain. I am getting error messages when I try to compile as soon as I put an include to the boost library in the...
1
5396
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started: Project: drawing_control, Configuration: Release Win32 ------ 1>Deleting intermediate and output files for project 'drawing_control', configuration 'Release|Win32'
15
4850
by: steve yee | last post by:
i want to detect if the compile is 32 bits or 64 bits in the source code itself. so different code are compiled respectively. how to do this?
9
3519
by: ThunderMusic | last post by:
Hi, I'd like to create a compile time error in my class... maybe there's a way already built in in the framework so I can achieve what I want... I have 2 constructors in my class. One of them has mandatory parameters, I mean, they should not be null nor empty (for strings). So I'd make the validation in the constructor and generate a compile-time error if the validation does not match... Is there a way to achieve this or to specify...
12
2766
by: Ioannis Vranos | last post by:
Perhaps a mechanism can be introduced in the C++0x/1x standard, something simple like defining a function as: void somefunc(void) throw() { // ... }
0
9538
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9353
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10123
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9909
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9788
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8794
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6623
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3889
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3481
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.