![]() |
|
#1
|
|||
|
|||
problem of c structure in .netHello,
I am working on c project. it currently shifted from Linux to windows and compiled in .net 2003. after running code, I got problem in printing value of double member which is present in structure. at debug time , i seen that value coming in to double variable but can't print by any type specifier like %f,%g etc. it's problem with structure declaration. if change location of double from middle to end of struct, it work! Can any one explain me why this happen? (I got solution for this problem using pragma pack directive. but i have to know, why this happen only with .net not on gcc or other c compiler.) This is related to boundary setting of structure. plz help me to understand. Thanks. Cheers, |
|
#3
|
|||
|
|||
|
plz reply some thing, so that i can got some hint!
thanks. |
|
#4
|
||||
|
||||
|
Quote:
I will only move this thread to the .NET Forum, if the code uses Managed Extensions; since you were able to port it to the new VC compiler (7.x is part of VS.NET, but it has 2 components, and the one you used is just a revised version of the plain c++ compiler from the previous versions) from gcc - I guess not. maprich asked you to show us the code you used; there's no way we can figure it out without seeing what you did. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#5
|
|||
|
|||
|
Quote:
Thanks for reply. the code for struct is like CPP / C++ / C Code:
anther structure which contain double it work fine. if i move this double varible at end of struct it work. thanks. Last edited by LuciWiz : 25-Aug-2005 at 12:47.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#6
|
|||
|
|||
|
Please post also:
Because the structure itself seems to be valid Please use code tags [c] and [/c] to make your code readable. |
|
#7
|
|||
|
|||
|
Thanks for reply. I am not sending code because nothing is wrong in code only problem related to .net.
After debugging code, I got problem in pointer addressing. when i copy information to structure pointer A and address of A is assign to other structure pointer B. The values are copied successfully but only value of double member of A is printed but not by B. code is like CPP / C++ / C Code:
Last edited by LuciWiz : 26-Aug-2005 at 04:11.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#8
|
|||
|
|||
|
Also one thing,
The get_info() function in another c file and function1() in another c file. the structure in get_info() function file declared static. is there any problem in accessing value using address from different c files in same project? |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| Introduction to .NET | LuciWiz | .NET Forum | 5 | 09-Aug-2007 05:53 |
| Visual Studio .NET 2003 problem in executing C source files | Debugger1 | C Programming Language | 14 | 04-Jun-2005 03:51 |
| Repetition structure problem and question | brookeville | C++ Forum | 17 | 29-Oct-2004 18:48 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The