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

Pointer-to-pointer-to-pointer question

The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
main()
{
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}

Nov 14 '05 #1
10 1540
ma**********@lycos.com wrote:
Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
(*tblPtr)[i] = ...

Note that x = malloc(n * sizeof *x);
is preferred to x = (type *) malloc(n * sizeof(type);
You should check that malloc doesn't return NULL.
You could change the return type of buildTbl to int ** and
return the array that way instead of through the parameter.

Do I remember that stuff Ok? Nice to see most of you are
still here!

Tobias
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
main()
{
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


Nov 14 '05 #2
ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?
You can get lost with the intricacies of C.
One "trick" to get around it: Use a local "pointer-to-pointer type"
variable to do as you always did and assign its value to the object
your "pointer-to-pointer-to-pointer type" argument points to.
-> Essentially the same code, one additional line.
(You perform all operations on *tblPtr which essentially means that
you could also work with a int **tbl and put *tblPtr=tbl at the end
if everything worked out)
If you follow Tobias's advice, it becomes even easier.
You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

[snip: Code]

Tobias Oed has already mentioned everything I can see.
Follow _every_ point of his advice regarding malloc().

BTW: Thank you for providing a good minimal example!
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #3
ma**********@lycos.com wrote:
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
The condition should be i < numRows.
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));


This will access memory not belonging to tblPtr if i is greater than 0.
Change it to the following:
(*tblPtr)[i] = malloc(numCols*sizeof(int));
It's also a good idea to check the return value of malloc().
Christian
Nov 14 '05 #4
ma**********@lycos.com wrote:

/* #define INLINE_INIT */

Masood void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int)); (*tblPtr)[i] = (int *)malloc(numCols*sizeof(int)); <------ /* C++: *tblPtr[i] = new (int)[numCols]; */
}


I am not a master of C, but what i can see is the problem of precedence.
And yes you should check the return value of malloc also.
Nov 14 '05 #5
ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
Return an int** instead.
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
Instead of allocating memory so many times, a better method
would be to call malloc only once to allocate all the
memory you need. This would improve the efficiency of
your code. (See example below.)


main()
{
int main (void)... is better.
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
Don't cast malloc or any other function that
returns a pointer unless you really know what you are
doing.

Should be tbl = malloc(...);
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
for (size_t i ... ) won't work with C'89.
Avoid it.
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
See above.
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


I've seen code that did not have proper braces
to block the scope of such for loops. The problem
I faced was that the formatting of the code was
lost and the code that followed that for
statement was a large "if statement".
Let me tell you, it wasn't easy to reformat that
code manually. Properly placing braces can save you a lot of time.
Use them.

Additionally, I don't see why, after you've been told before,
you don't use a proper NG client to post. It is *difficult*
to read unindented code. Please use a good client.
/* grid_alloc.c. */
#include <stdlib.h>

int **grid_alloc (size_int rows, size_int cols)
{
int **mem; /* allocated memory */
int *p; /* temporary ptr */
size_int r; /* row index */

mem = malloc (rows * cols * sizeof(int) + rows * sizeof(*mem));
if(mem != NULL)
{
/* memory layout:
* [ pointers: one pointer to each row of data ][ data ]
*/
for (r = 0, p = (int*)mem + rows; r < rows; ++r, p += cols)
{
mem[r] = p;
}
}

return mem;
}

/* ... */

This allows you to use array syntax to address elements.
Don't forget to use free() when you're done with it, however.

Regards,
Jonathan.

--
Email: "jonathan [period] burd [commercial-at] gmail [period] com" sans-WSP

"We must do something. This is something. Therefore, we must do this."
- Keith Thompson
Nov 14 '05 #6
Jonathan Burd wrote:
ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{

Return an int** instead.
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
/* C++: *tblPtr[i] = new (int)[numCols]; */
}

Instead of allocating memory so many times, a better method
would be to call malloc only once to allocate all the
memory you need. This would improve the efficiency of
your code. (See example below.)


main()
{

int main (void)... is better.
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));

Don't cast malloc or any other function that
returns a pointer unless you really know what you are
doing.

Should be tbl = malloc(...);
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)

for (size_t i ... ) won't work with C'89.
Avoid it.
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));

See above.
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


I've seen code that did not have proper braces
to block the scope of such for loops. The problem
I faced was that the formatting of the code was
lost and the code that followed that for
statement was a large "if statement".
Let me tell you, it wasn't easy to reformat that
code manually. Properly placing braces can save you a lot of time.
Use them.

Additionally, I don't see why, after you've been told before,
you don't use a proper NG client to post. It is *difficult*
to read unindented code. Please use a good client.
/* grid_alloc.c. */
#include <stdlib.h>

int **grid_alloc (size_int rows, size_int cols)
{
int **mem; /* allocated memory */
int *p; /* temporary ptr */
size_int r; /* row index */


Typos. Should be size_int should be size_t. The editor
I was using to search-n-replace goofed. :|
mem = malloc (rows * cols * sizeof(int) + rows * sizeof(*mem));
if(mem != NULL)
{
/* memory layout:
* [ pointers: one pointer to each row of data ][ data ]
*/
for (r = 0, p = (int*)mem + rows; r < rows; ++r, p += cols)
{
mem[r] = p;
}
}

return mem;
}

/* ... */

This allows you to use array syntax to address elements.
Don't forget to use free() when you're done with it, however.

Regards,
Jonathan.

--
Email: "jonathan [period] burd [commercial-at] gmail [period] com" sans-WSP

"We must do something. This is something. Therefore, we must do this."
- Keith Thompson
Nov 14 '05 #7
On 2 Feb 2005 20:26:42 -0800, ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
This line is interpreted as
*(tblPtr[i]) = ...

You want
(*tblPtr)[i] = ...

The parentheses are not optional.
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
main()
{
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


<<Remove the del for email>>
Nov 14 '05 #8
On 2 Feb 2005 20:26:42 -0800, ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
This line is interpreted as
*(tblPtr[i]) = ...

You want
(*tblPtr)[i] = ...

The parentheses are not optional.
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
main()
{
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


<<Remove the del for email>>
Nov 14 '05 #9
On 2 Feb 2005 20:26:42 -0800, ma**********@lycos.com wrote:
The code example below shows the dynamic allocation of a 2D array. I
must admit that it took quite a while for me to get there (I already
have another posting to that effect), but I am glad that I finally got
it working. Now here's the problem:

I am able to get the 2D array dynamically allocated correctly as long
as I am doing it "in-line" (i.e. without invoking any function). The
moment I try to do it in another function, I get a core dump. Any help
will be appreciated.

Since this function is expected to update a pointer-to-pointer type, I
am actually passing the pointer-to-pointer-to-pointer type to the
function. What am I missing here?

You can see that the source code works correctly when I am perform 2D
array initialization "in-line" (i.e. by not invoking a function
call) simply by un-commenting the line

/* #define INLINE_INIT */

Masood

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

/*#define INLINE_INIT*/

#define MAXROWS 3
#define MAXCOLS 5
void
buildTbl(int ***tblPtr, size_t numRows, size_t numCols)
{
*tblPtr = (int **)malloc(numRows*sizeof(int*));
/* C++ : *tblPtr = new (int*)[numRows]; */

for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));
This line is interpreted as
*(tblPtr[i]) = ...

You want
(*tblPtr)[i] = ...

The parentheses are not optional.
/* C++: *tblPtr[i] = new (int)[numCols]; */
}
main()
{
int startVal = 5;

int **tbl;

#ifdef INLINE_INIT
tbl = (int **)malloc(MAXROWS*sizeof(int*));
/* C++ : tbl = new (int*)[MAXROWS]; */

for(size_t i = 0; i < MAXCOLS; i++)
tbl[i] = (int *)malloc(MAXCOLS*sizeof(int));
/* C++: tbl[i] = new (int)[MAXCOLS]; */
#else
buildTbl(&tbl, MAXROWS, MAXCOLS);
#endif

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
tbl[row][col] = startVal++;

for(size_t row = 0; row < MAXROWS; row++)
for(size_t col = 0; col < MAXCOLS; col++)
printf("Row: %d, Col: %d => %d\n",
row, col, tbl[row][col]);
return 0;
}


<<Remove the del for email>>
Nov 14 '05 #10
[Side note: the article to which I am posting a follow-up got posted
three times, with three different message-IDs. Software glitch, I
presume.]
On 2 Feb 2005 20:26:42 -0800, ma**********@lycos.com wrote:
for(size_t i = 0; i < numCols; i++)
*tblPtr[i] = (int *)malloc(numCols*sizeof(int));

In article <c0********************************@4ax.com>
Barry Schwarz <sc******@deloz.net> wrote:This line is interpreted as
*(tblPtr[i]) = ...

You want
(*tblPtr)[i] = ...

The parentheses are not optional.


Right. Note, however, that if for some reason one finds the
parenthesized form objectionable, (*p)[i] can be rewritten as
p[0][i]. (Likewise, p->field can be rewritten as p[0].field.)

I think this particular rewrite is misleading and would avoid
it myself. In fact, I would probably use code of the form:

nonvoid_return_type some_fn(T ***ptable, ...) {
T **table;

... do all the local work with table and table[i] ...

*ptable = table;
return other_useful_return_value;
}

or, as in this particular case (where the function had "void" as
its return type), just return a "T **" value and eliminate the
three-levels-deep pointer argument.
--
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.
Nov 14 '05 #11

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

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
6
semanticnotion
by: semanticnotion | last post by:
Hi sir i want to transform the data of one table into another through foreign key but the following error come to my browser Here is my code and data base structure. CREATE TABLE IF NOT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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,...
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...

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.