cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Toolkit - initializing a ProDwgtable before use?

msteffke
12-Amethyst

Toolkit - initializing a ProDwgtable before use?

Compiling some code in MVS2012 that has always compiled for me in the past.   I get these "uninitialzed local variable"  'table' used.   Where table is declared as a pointer to ProDwgTable.   Like ProDwgtable *table;

How would you even initialize such a variable?

 

The call that reference table and that throws this flag is:

tkerr = ProDwgtableRetrieve((ProDrawing)drawing, wName, wPath, 0, point, (ProMdl)solids[0], NULL, table);

 

Thanks for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
msteffke
12-Amethyst
(To:msteffke)

I ended up just setting these to NULL before use. 

View solution in original post

2 REPLIES 2
msteffke
12-Amethyst
(To:msteffke)

I ended up just setting these to NULL before use. 

PARTHIBAN_K
15-Moonstone
(To:msteffke)

Hi @msteffke

 

In C/C++ Program it is always best practice to use NULL Pointers

 

1. Always initialize pointer variables as NULL.
2. Always perform NULL check before accessing any pointer.

 

Refer this link for more information

http://www.geeksforgeeks.org/few-bytes-on-null-pointer-in-c/

Parthiban Kannan

href="https://www.linkedin.com/in/parthiban-kannan/" target="_blank"
Top Tags