-
object (its delegate).
class Rectangle(
val width:
Int,
val height:
Int) { fun area() =
width *
height }
class Window(
val bounds: Rectangle) { // Delegation...
- header):
int val = 20; /* 8
octets of
header + 12
octets of the
application protocol. */ (void)setsockopt(fd, SOL_UDPLITE, UDPLITE_SEND_CSCOV, &
val, sizeof...
- reached:
int find(
int arr[],
size_t len,
int val) {
int last; if (len == 0)
return -1; last = arr[len - 1]; arr[len - 1] =
val; // add
sentinel value int i;...
- PrintNumber(
int (*getNumber)(void)) {
int val = getNumber(); printf("Value: %d\n",
val); }
int GetAnswerToMostImportantQuestion(void) {
return 42; }
int main(void)...
- sig type t
val zero : t
val succ : t -> t
val sum : t * t -> t end
structure Rational :
ARITH =
struct datatype t = Rat of
int *
int val zero = Rat (0...
- Print(const std::vector<
int>& vec) { for (auto
val : vec) { std::cout <<
val << ' '; } std::cout << '\n'; }
int main() { std::vector<
int> v = {0, 1, 2, 3, 4...
- C:
struct node {
int val;
struct node *next; }; This is an
example using typedefs:
typedef struct node node;
struct node {
int val; node *next; }; Note:...
- or a
special value, a
variant must be used.
Function GetText(Optional By
Val Index) As
String If IsMissing(Index) Then
GetText = Item(CurrentItem) Else...
-
value of the
first argument argh = vpi_scan(args_iter); argval.format = vpi
IntVal; vpi_get_value(argh, &argval);
value = argval.value.integer; vpi_printf("VPI...
-
implicit def
IntPredicate(i:
Int) = new
IntPredicate(i). The
class can also be
defined as
implicit class IntPredicates(
val i:
Int)
extends Any
Val { ... },...