Tags » C-2

Structure memory padding

#include <stdio.h>
struct structureA{
  char a;
  int b;
  short int c;
struct structureB{
  int a;
  short int b;
  char c;
int main(void) {
printf("Size of structureA = %d\n",sizeof(struct structureA));
printf("Size of structureB = %d\n",sizeof(struct structureB));
return 0;
… 119 more words

Custom Error Pages in MVC 4

Default solution: Use MVC HandleErrorAttribute


In MVC, by default, you will have in your Global.ascx, under Application_Start()


And in RegisterGlobalFilters, you will have…

public static void RegisterGlobalFilters(GlobalFilterCollection filters) 
      filters.Add(new HandleErrorAttribute()); 
… 222 more words

Data members and member functions in C

We can create classes with data members and member functions in C. We cant store function definitions inside struct. But we can have function pointers inside struct. 86 more words


Interactive menus for UnitC++

UnitC++ has gone to version 1.1.0. The new feature is the addition of an interactive menu system. You run your tests declared using the TEST… 92 more words



Hi, just thought to share little knowledge on reflection with you all, as per being a developer, I was very curious to find how visual studio is giving intellisence, that took me to learn reflection and I found its really good to know about it.so I will start with using a pattern, in this way you will get to know about two things. 303 more words

Mindfire Solutions

Bit Arithmetic in C

Binary OR(|):
X | 1 => 1 (Sets the bit)
X | 0 => 0 (Leaves bit unchanged)

Binary AND(&):
X & 0 => 0 (Resets the bit) 144 more words


strtok() in C

#include <string.h>
#include <stdio.h>

int main(void){
char string = "Hello:World,This is-strtok";
char *token;
token = strtok(string,": ,-");
while(token != NULL){
token = strtok(NULL,": ,-");
return 0;
… 69 more words