![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Segmentation fault | big123456 | Linux | 0 | 07-20-2007 05:01 AM |
| Segmentation fault | rshaikh | AIX | 2 | 04-16-2007 08:12 AM |
| segmentation fault | rockgal | High Level Programming | 8 | 12-05-2006 12:16 PM |
| Segmentation Fault | compbug | UNIX for Dummies Questions & Answers | 3 | 04-21-2006 10:43 AM |
| segmentation fault | wojtyla | High Level Programming | 3 | 02-19-2005 02:53 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
segmentation fault
If I do this.
Assume Code:
struct life
{
char *nolife;
}
struct life **life;
// malloc initialization & everything
if(life->nolife[index] == 0)
wrong accession? |
|
||||
|
Quote:
Also, since life is a pointer to pointer to struct life, Quote:
Quote:
|
|
||||
|
spirtle is right nolife is a pointer to char while life is a pointer to pointer to struct so it shouldn't compile. And don't use same name for a structure tag and a dual level pointer.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|