views:

96

answers:

3

I am using visual studio 2008 express edition.

A normal win32 console C project with the code below:

int main(void)
{

struct _addr_info
{
 char name[30];
 char street[40];
 char city[20];
 char state[3];
 unsigned long int zip;
} addr_info;

addr_info.zip = 12345;


return 0;
}

Generally for structures intellisense will list the members. Here it doesnt however it compiles fine and at debugging i checked the data also gets entered properly. Am i doing something wrong.

even this code has same prob.

int main(void)
{

struct 
{
 char name[30];
 char street[40];
 char city[20];
 char state[3];
 unsigned long int zip;
} addr_info;

addr_info.zip = 12345;


return 0;
}

This code below also doesn't work.

int main(void)
{

struct _addr_info
{
 char name[30];
 char street[40];
 char city[20];
 char state[3];
 unsigned long int zip;
} ;

struct _addr_info addr_info;
addr_info.zip = 12345;


return 0;
}

The code below works fine and list the members of the structure.

struct _addr_info
{
    char name[30];
    char street[40];
    char city[20];
    char state[3];
    unsigned long int zip;
} addr_info;

int main(void)
{
    addr_info.zip = 12345;
    return 0;
}

This one too.

    struct _addr_info
{
    char name[30];
    char street[40];
    char city[20];
    char state[3];
    unsigned long int zip;
} ;

int main(void)
{
    struct _addr_info addr_info;
    addr_info.zip = 12345;
    return 0;
}
A: 

If you're used to Visual C#'s intellisense then you'll be extremely disappointed in Visual C++'s as it's very buggy. You can try deleting the ncb files but you're better off using something like Visual Assist which is an intellisense replacement.

jestro
deleting ncb and rebuilding solution (after cleaning) doesnt make any difference.
Kavitesh Singh
Visual Assist is paid and seems doesnt support any express edition.
Kavitesh Singh
A: 

Answer copied from [ http://stackoverflow.com/questions/1574875/ ]

There's something about your situation described by Microsoft: http://support.microsoft.com/kb/822551

WORKAROUND: Microsoft strongly recommends that you use unique type definitions.

pmg
+1  A: 

I posted on MSDN forum and got the answer pointed by the link.

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvc/thread/8a22dc4a-3632-4cb9-92a3-63a18b55e7b6

Hope this helps.

Kavitesh Singh
+1 Nice of you to update your question.
pmg