1st
MAY

Zero-extent array members

Posted by Strainu | Filed under C

Some compilers, such as GCC or IBM’s compiler have a C extension that allows for a zero-extent array members of a structure to be declared:

struct inode{
  //other members
  char data[0];
};

They are very useful if you have a structure for a variable-length object. Until they are allocated the zero-extent members will not take up any memmory. When you have to allocate memory for such a structure, you can do it this way:

struct inode *ind = (struct inode*) malloc(sizeof(struct inode) + size_of_the_array);

You have to keep in mind that this is a language extension. The C99 standard only allows flexible array members, which are defined as

char array[];

(without the 0) and behave somewhat differently. You can find out more about the subject in the GCC Manual.

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: ,

30th
JAN

Computer Systems’ Structure homeworks

Posted by Strainu | Filed under C, Python, Software

Computer Systems’ Structure homeworks from Automatics and Computer Science Faculty, 4th year, prof. Emil Sluşanschi. The archive contains a homework made in C. Themes: threads, semaphores, queues, locks, fat-tree inter-connection structures, file-sharing, network programming in python. The C homework is a simulation using the Blitzen simulator (not included).
(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

30th

Operating Systems homeworks

Posted by Strainu | Filed under C, Software

Operating Systems homeworks from the Automatics and Computer Science Faculty, 4th year, prof. Marius Dorian Zaharia. Themes:

  • using Linux;
  • bash;
  • processes and threads in Linux;
  • IPC: semaphores, message queues, signals, shared memory;
  • readers-writers, producers-consumers and philosopher’s problems.

(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , , ,

12th
JUL

Networking Protocols homeworks

Posted by Strainu | Filed under C, Software

Networking Protocols homeworks Networking Protocols homeworks, Automatics and Computer Science Faculty, UPB, 3rd year, prof. Florin Pop or Valentin Cristea.

The software is distributed under CC-GNU GPL license.

Download

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , ,

29th
MAR

Algorithm Analysis Labs

Posted by Strainu | Filed under C, Software

Algorithm Analysis Labs (sorting methods and graph labs), Automatics and Computer Science Faculty, UPB, 3rd year, prof. Cristian Giumale

The software is distributed under CC-GNU GPL license.

Download

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , ,

26th
MAR

Algorithms and Data Structures Labs

Posted by Strainu | Filed under C, Software

Algorithms and Data Structures Labs Algorithms and Data Structures labs, Automatics and Computer Science Faculty, UPB, 1st year, prof. Florian Moraru

The software is distributed under CC-GNU GPL license.

Download

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

26th

Computer Graphics Labs

Posted by Strainu | Filed under C, C++, Software

Computer Graphics Labs Computer Graphics labs (DOS-graphics and OpenGL), Automatics and Computer Science Faculty, UPB, 3rd year, prof. Marius Dorian Zaharia

The software is distributed under CC-GNU GPL license.

Download

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , ,

26th

C-Programming Labs

Posted by Strainu | Filed under C, Software

C-Programming Labs Computer Programming labs, Automatics and Computer Science Faculty, UPB, 1st year, prof. Eugenia Kalisz. (more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,