Explore chapters and articles related to this topic
C Programming
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
Initialization is a useful way of giving a value to a variable when it is declared. One way to change this value when the program is run is through the assignment operator =. This operator appears to the right of a single variable (called an l-value). The value of the expression to the right of the assignment operator is placed in the memory location of the l-value. The expression on the right can be a simple constant or variable, or a complicated expression of values, variables, functions, and operators. (Functions and operators will be presented in subsequent sections.) Consider the simple examples in Figure 13.11.
ETPS-MAC: Energy Traffic Priority Scheduling-based QoS-aware MAC protocol for hierarchical WSNs
Published in International Journal of Electronics, 2019
The elected CHs calculate the Join_Req messages to evaluate the number of nodes associated with it and then set the TDMA schedule for intra-cluster communication. It broadcasts this schedule information to its member nodes through TDMA_Schedule message which comprises of frame control, frame duration, number of frames, allocated one-bit control slot number, the total number of control slots and frame check sequence (FCS). The length of TDMA_Schedule message within a cluster is proportional to the number of member nodes associated with the cluster. From the assignment message, the node also gets the information about the end of SP and initialization of SSP.
A GCC-based checker for compliance with MISRA-C's single-translation-unit rules
Published in Connection Science, 2023
Chih-Yuan Chen, Yung-An Fang, Guan-Ren Wang, Peng-Sheng Chen
Rule 7.2 states: “A ‘u’ or ‘U’ suffix shall be applied to all integer constants that are represented in an unsigned type” (MISRA C Working Group, 2013, p. 60). Figure 5 shows the example code. In addition to variable declaration with initialization, passing function arguments also need to be checked. Traditional C does not allow the “u” suffix. Therefore, we can write a statement such as shown in Figure 6(a), and then compile it using the option -Wtraditional to trigger the warning message shown in Figure 6(b). This is an entry point to locate the relevant code fragments in GCC.
Integrated scheduling of yard cranes, external trucks, and internal trucks in maritime container terminal operation
Published in Maritime Policy & Management, 2023
The initialization routine for an individual is composed of the assignment subroutine and the routing subroutine, which, respectively, correspond to the assignment subproblem and the routing subproblem of the yard crane scheduling problem. Take the th row of container blocks with yard cranes and trucks as an example. A vector for the assignment scheme is formatted as the following vector.