answersLogoWhite

0


Best Answer

it's a byte used for speed optimization. It aligns bytes so that the can be read from the structure faster.

Its an extra byte, sometimes placed between structure members to align other structure members on appropriate word, double word, or quad word boundaries. It is often necessary when mixing libraries between different vendors, so as to make sure the structures align correctly and have the proper performance. Slack byte control, in the Microsoft world, is controlled by the /zpx compiler parameter. I have also seen the need to deal with slack bytes when programming with mixed assembler and COBOL in a mainframe environment, in the working storage division.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is slack byte in structures in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you store the data into byte in c?

There is not built-in 'byte' type in C, but you can define it: typedef unsigned char byte; byte bmin=0, bmax=255;


What is the format specifire of data type BYTE?

Nothing (actually there is no BYTE in C). Use one of these: %c %x %u %o %d.


Who killed vernon c byte?

Himself. It was suicide.


How do stuctures in C and C plus plus differ?

Structures in C and C++ differ in that C structures do not have an automatic typdef associated with them.


Byte stuffing program in c?

teri bhen ki.....................


Why structure variables cannot be compared?

They can be compared with memcmp, but you should be careful if your structures contain:- pointers- alignment gaps- numeric variables (byte order!)- nested structures/unions


How do you convert text into binary in vb or c sharp code?

C# EXAMPLEString text="My sample data";System.Text.ASCIIEncoding encode=new System.Text.ASCIIEncoding();//convert to binary and store in a byte[]byte[] binaryArray=encode.GetBytes(text);


What has the author Bijan Mashaw written?

Bijan Mashaw has written: 'C++ programming byte by byte' 'Programming byte by byte' -- subject(s): FORTRAN 77 (Computer program language), Structured programming 'BASIC' -- subject(s): BASIC (Computer program language)


C program for comparison of dates using structures?

C program for comparison of dates using structures


How much memory is required to store a 'character' and how much is required to store a 'string'?

a character/byte as defined in the C programming language is one byte (8 bits). A string can be as short as one byte and can be as long as the physical memory limits can contain it.


How is memory allocated in c program for a character data type?

One byte for every character.


Write a program in java to print average no of alphabets present in each word?

import java.io.*; class AvgWordSent { protected static void main()throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter the Sentence: "); String s=in.readLine(); byte a=0,b=0; float c=0; for(byte i=0;i<s.length();i++) { if(s.charAt(i)==' ') a++; } String w[]=new String[a+1]; for(byte i=0;i<=a;i++) w[i]=""; for(byte i=0;i<s.length();i++) { if(s.charAt(i)==' ') { b++; continue; } w[b]+=s.charAt(i); } b++; for(byte i=0;i<=a;i++) c+=w[i].length(); System.out.print("Average no. of words= "+(c/b)); } }