Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to call a Dll Pin
Hamid_RT6-Jan-09 20:19
Hamid_RT6-Jan-09 20:19 
AnswerRe: How to call a Dll Pin
CPallini6-Jan-09 21:57
mveCPallini6-Jan-09 21:57 
AnswerRe: How to call a Dll Pin
nyeboy7-Jan-09 21:16
nyeboy7-Jan-09 21:16 
Questionstruct definition with : Pin
KASR16-Jan-09 18:20
KASR16-Jan-09 18:20 
AnswerRe: struct definition with : Pin
«_Superman_»6-Jan-09 18:48
professional«_Superman_»6-Jan-09 18:48 
GeneralRe: struct definition with : Pin
KASR16-Jan-09 19:09
KASR16-Jan-09 19:09 
AnswerRe: struct definition with : [modified] Pin
«_Superman_»6-Jan-09 19:15
professional«_Superman_»6-Jan-09 19:15 
GeneralRe: struct definition with : Pin
Stuart Dootson7-Jan-09 1:42
professionalStuart Dootson7-Jan-09 1:42 
Superman's answer is incorrect - the behaviour on assignment of a value that cannot be held in the bit-field is implementation (i.e. compiler) dependent - that's what the C++ Standard says (section 4.7p3), anyway, and I suspect the C standard will be much the same.

Certainly, for Microsoft C/C++, values are truncated to what will fit in the bit-field. Consider this code:

#include <stdio.h>

struct X
{
   unsigned int a : 3;
   unsigned int b : 3;
};

int main(int argc, char** argv)
{
   {
      struct X x = {0};
      x.a = 15;
      printf("x.a = %d, x.b = %d\n", (int)x.a, (int)x.b);
   }
   {
      struct X x = {0};
      x.b = 15;
      printf("x.a = %d, x.b = %d\n", (int)x.a, (int)x.b);
   }
   return 0;
}
This produces the following output when compiled as C or C++:
x.a = 7, x.b = 0
x.a = 0, x.b = 7





AnswerRe: struct definition with : Pin
Randor 6-Jan-09 19:26
professional Randor 6-Jan-09 19:26 
AnswerRe: struct definition with : Pin
John R. Shaw7-Jan-09 6:32
John R. Shaw7-Jan-09 6:32 
QuestionHow to read unicode text files Pin
PS@Codeproj6-Jan-09 17:39
PS@Codeproj6-Jan-09 17:39 
AnswerRe: How to read unicode text files Pin
«_Superman_»6-Jan-09 17:51
professional«_Superman_»6-Jan-09 17:51 
AnswerRe: How to read unicode text files Pin
John R. Shaw7-Jan-09 6:59
John R. Shaw7-Jan-09 6:59 
QuestionCAtlRegEx Unhandled Exception Pin
dehseth6-Jan-09 4:45
dehseth6-Jan-09 4:45 
AnswerRe: CAtlRegEx Unhandled Exception Pin
JaydeepB6-Jan-09 8:47
JaydeepB6-Jan-09 8:47 
QuestionMFC Dialog application Pin
bhanu_85096-Jan-09 3:55
bhanu_85096-Jan-09 3:55 
AnswerRe: MFC Dialog application Pin
CPallini6-Jan-09 4:07
mveCPallini6-Jan-09 4:07 
GeneralRe: MFC Dialog application Pin
bhanu_85096-Jan-09 23:14
bhanu_85096-Jan-09 23:14 
GeneralRe: MFC Dialog application Pin
CPallini6-Jan-09 23:51
mveCPallini6-Jan-09 23:51 
AnswerRe: MFC Dialog application Pin
Rajesh R Subramanian6-Jan-09 4:40
professionalRajesh R Subramanian6-Jan-09 4:40 
JokeRe: MFC Dialog application Pin
CPallini6-Jan-09 5:19
mveCPallini6-Jan-09 5:19 
GeneralRe: MFC Dialog application Pin
Rajesh R Subramanian7-Jan-09 4:16
professionalRajesh R Subramanian7-Jan-09 4:16 
GeneralRe: MFC Dialog application Pin
CPallini7-Jan-09 6:05
mveCPallini7-Jan-09 6:05 
AnswerRe: MFC Dialog application Pin
led mike6-Jan-09 4:56
led mike6-Jan-09 4:56 
GeneralRe: MFC Dialog application Pin
Nemanja Trifunovic6-Jan-09 6:15
Nemanja Trifunovic6-Jan-09 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.