Next: Execution Control Expressions , Previous: Arithmetic , Up: Top   [ Contents ][ Index ]

7 Assignment Expressions

As a general concept in programming, an assignment is a construct that stores a new value into a place where values can be stored—for instance, in a variable. Such places are called lvalues (see Lvalues ) because they are locations that hold a value.

An assignment in C is an expression because it has a value; we call it an assignment expression . A simple assignment looks like

We say it assigns the value of the expression value-to-store to the location lvalue , or that it stores value-to-store there. You can think of the “l” in “lvalue” as standing for “left,” since that’s what you put on the left side of the assignment operator.

However, that’s not the only way to use an lvalue, and not all lvalues can be assigned to. To use the lvalue in the left side of an assignment, it has to be modifiable . In C, that means it was not declared with the type qualifier const (see const ).

The value of the assignment expression is that of lvalue after the new value is stored in it. This means you can use an assignment inside other expressions. Assignment operators are right-associative so that

is equivalent to

This is the only useful way for them to associate; the other way,

would be invalid since an assignment expression such as x = y is not valid as an lvalue.

Warning: Write parentheses around an assignment if you nest it inside another expression, unless that is a conditional expression, or comma-separated series, or another assignment.

CProgramming Tutorial

  • C Programming Tutorial
  • C - Overview
  • C - Features
  • C - History
  • C - Environment Setup
  • C - Program Structure
  • C - Hello World
  • C - Compilation Process
  • C - Comments
  • C - Keywords
  • C - Identifiers
  • C - User Input
  • C - Basic Syntax
  • C - Data Types
  • C - Variables
  • C - Integer Promotions
  • C - Type Conversion
  • C - Booleans
  • C - Constants
  • C - Literals
  • C - Escape sequences
  • C - Format Specifiers
  • C - Storage Classes
  • C - Operators
  • C - Arithmetic Operators
  • C - Relational Operators
  • C - Logical Operators
  • C - Bitwise Operators
  • C - Assignment Operators
  • C - Unary Operators
  • C - Increment and Decrement Operators
  • C - Ternary Operator
  • C - sizeof Operator
  • C - Operator Precedence
  • C - Misc Operators
  • C - Decision Making
  • C - if statement
  • C - if...else statement
  • C - nested if statements
  • C - switch statement
  • C - nested switch statements
  • C - While loop
  • C - For loop
  • C - Do...while loop
  • C - Nested loop
  • C - Infinite loop
  • C - Break Statement
  • C - Continue Statement
  • C - goto Statement
  • C - Functions
  • C - Main Functions
  • C - Function call by Value
  • C - Function call by reference
  • C - Nested Functions
  • C - Variadic Functions
  • C - User-Defined Functions
  • C - Callback Function
  • C - Return Statement
  • C - Recursion
  • C - Scope Rules
  • C - Static Variables
  • C - Global Variables
  • C - Properties of Array
  • C - Multi-Dimensional Arrays
  • C - Passing Arrays to Function
  • C - Return Array from Function
  • C - Variable Length Arrays
  • C - Pointers
  • C - Pointers and Arrays
  • C - Applications of Pointers
  • C - Pointer Arithmetics
  • C - Array of Pointers
  • C - Passing Pointers to Functions
  • C - Strings
  • C - Array of Strings
  • C - Structures
  • C - Structures and Functions
  • C - Arrays of Structures
  • C - Pointers to Structures
  • C - Self-Referential Structures
  • C - Nested Structures
  • C - Bit Fields
  • C - Typedef
  • C - Input & Output
  • C - File I/O
  • C - Preprocessors
  • C - Header Files
  • C - Type Casting
  • C - Error Handling
  • C - Variable Arguments
  • C - Memory Management
  • C - Command Line Arguments
  • C Programming Resources
  • C - Questions & Answers
  • C - Quick Guide
  • C - Useful Resources
  • C - Discussion
  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • HR Interview Questions
  • Computer Glossary

Assignment Operators in C

In C language, the assignment operator stores a certain value in an already declared variable. A variable in C can be assigned the value in the form of a literal, another variable, or an expression.

The value to be assigned forms the right-hand operand, whereas the variable to be assigned should be the operand to the left of the " = " symbol, which is defined as a simple assignment operator in C.

In addition, C has several augmented assignment operators.

The following table lists the assignment operators supported by the C language −

Simple Assignment Operator (=)

The = operator is one of the most frequently used operators in C. As per the ANSI C standard, all the variables must be declared in the beginning. Variable declaration after the first processing statement is not allowed.

You can declare a variable to be assigned a value later in the code, or you can initialize it at the time of declaration.

You can use a literal, another variable, or an expression in the assignment statement.

Once a variable of a certain type is declared, it cannot be assigned a value of any other type. In such a case the C compiler reports a type mismatch error.

In C, the expressions that refer to a memory location are called "lvalue" expressions. A lvalue may appear as either the left-hand or right-hand side of an assignment.

On the other hand, the term rvalue refers to a data value that is stored at some address in memory. A rvalue is an expression that cannot have a value assigned to it which means an rvalue may appear on the right-hand side but not on the left-hand side of an assignment.

Variables are lvalues and so they may appear on the left-hand side of an assignment. Numeric literals are rvalues and so they may not be assigned and cannot appear on the left-hand side. Take a look at the following valid and invalid statements −

Augmented Assignment Operators

In addition to the = operator, C allows you to combine arithmetic and bitwise operators with the = symbol to form augmented or compound assignment operator. The augmented operators offer a convenient shortcut for combining arithmetic or bitwise operation with assignment.

For example, the expression "a += b" has the same effect of performing "a + b" first and then assigning the result back to the variable "a".

Run the code and check its output −

Similarly, the expression "a <<= b" has the same effect of performing "a << b" first and then assigning the result back to the variable "a".

Here is a C program that demonstrates the use of assignment operators in C −

When you compile and execute the above program, it will produce the following result −

To Continue Learning Please Login

Home » Learn C Programming from Scratch » C Assignment Operators

C Assignment Operators

Summary : in this tutorial, you’ll learn about the C assignment operators and how to use them effectively.

Introduction to the C assignment operators

An assignment operator assigns the vale of the right-hand operand to the left-hand operand. The following example uses the assignment operator (=) to assign 1 to the counter variable:

After the assignmment, the counter variable holds the number 1.

The following example adds 1 to the counter and assign the result to the counter:

The = assignment operator is called a simple assignment operator. It assigns the value of the left operand to the right operand.

Besides the simple assignment operator, C supports compound assignment operators. A compound assignment operator performs the operation specified by the additional operator and then assigns the result to the left operand.

The following example uses a compound-assignment operator (+=):

The expression:

is equivalent to the following expression:

The following table illustrates the compound-assignment operators in C:

  • A simple assignment operator assigns the value of the left operand to the right operand.
  • A compound assignment operator performs the operation specified by the additional operator and then assigns the result to the left operand.

C Programming Tutorial

  • Assignment Operator in C

Last updated on July 27, 2020

We have already used the assignment operator ( = ) several times before. Let's discuss it here in detail. The assignment operator ( = ) is used to assign a value to the variable. Its general format is as follows:

The operand on the left side of the assignment operator must be a variable and operand on the right-hand side must be a constant, variable or expression. Here are some examples:

The precedence of the assignment operator is lower than all the operators we have discussed so far and it associates from right to left.

We can also assign the same value to multiple variables at once.

here x , y and z are initialized to 100 .

Since the associativity of the assignment operator ( = ) is from right to left. The above expression is equivalent to the following:

Note that expressions like:

are called assignment expression. If we put a semicolon( ; ) at the end of the expression like this:

then the assignment expression becomes assignment statement.

Compound Assignment Operator #

Assignment operations that use the old value of a variable to compute its new value are called Compound Assignment.

Consider the following two statements:

Here the second statement adds 5 to the existing value of x . This value is then assigned back to x . Now, the new value of x is 105 .

To handle such operations more succinctly, C provides a special operator called Compound Assignment operator.

The general format of compound assignment operator is as follows:

where op can be any of the arithmetic operators ( + , - , * , / , % ). The above statement is functionally equivalent to the following:

Note : In addition to arithmetic operators, op can also be >> (right shift), << (left shift), | (Bitwise OR), & (Bitwise AND), ^ (Bitwise XOR). We haven't discussed these operators yet.

After evaluating the expression, the op operator is then applied to the result of the expression and the current value of the variable (on the RHS). The result of this operation is then assigned back to the variable (on the LHS). Let's take some examples: The statement:

is equivalent to x = x + 5; or x = x + (5); .

Similarly, the statement:

is equivalent to x = x * 2; or x = x * (2); .

Since, expression on the right side of op operator is evaluated first, the statement:

is equivalent to x = x * (y + 1) .

The precedence of compound assignment operators are same and they associate from right to left (see the precedence table ).

The following table lists some Compound assignment operators:

The following program demonstrates Compound assignment operators in action:

Expected Output:

Load Comments

  • Intro to C Programming
  • Installing Code Blocks
  • Creating and Running The First C Program
  • Basic Elements of a C Program
  • Keywords and Identifiers
  • Data Types in C
  • Constants in C
  • Variables in C
  • Input and Output in C
  • Formatted Input and Output in C
  • Arithmetic Operators in C
  • Operator Precedence and Associativity in C
  • Increment and Decrement Operators in C
  • Relational Operators in C
  • Logical Operators in C
  • Conditional Operator, Comma operator and sizeof() operator in C
  • Implicit Type Conversion in C
  • Explicit Type Conversion in C
  • if-else statements in C
  • The while loop in C
  • The do while loop in C
  • The for loop in C
  • The Infinite Loop in C
  • The break and continue statement in C
  • The Switch statement in C
  • Function basics in C
  • The return statement in C
  • Actual and Formal arguments in C
  • Local, Global and Static variables in C
  • Recursive Function in C
  • One dimensional Array in C
  • One Dimensional Array and Function in C
  • Two Dimensional Array in C
  • Pointer Basics in C
  • Pointer Arithmetic in C
  • Pointers and 1-D arrays
  • Pointers and 2-D arrays
  • Call by Value and Call by Reference in C
  • Returning more than one value from function in C
  • Returning a Pointer from a Function in C
  • Passing 1-D Array to a Function in C
  • Passing 2-D Array to a Function in C
  • Array of Pointers in C
  • Void Pointers in C
  • The malloc() Function in C
  • The calloc() Function in C
  • The realloc() Function in C
  • String Basics in C
  • The strlen() Function in C
  • The strcmp() Function in C
  • The strcpy() Function in C
  • The strcat() Function in C
  • Character Array and Character Pointer in C
  • Array of Strings in C
  • Array of Pointers to Strings in C
  • The sprintf() Function in C
  • The sscanf() Function in C
  • Structure Basics in C
  • Array of Structures in C
  • Array as Member of Structure in C
  • Nested Structures in C
  • Pointer to a Structure in C
  • Pointers as Structure Member in C
  • Structures and Functions in C
  • Union Basics in C
  • typedef statement in C
  • Basics of File Handling in C
  • fputc() Function in C
  • fgetc() Function in C
  • fputs() Function in C
  • fgets() Function in C
  • fprintf() Function in C
  • fscanf() Function in C
  • fwrite() Function in C
  • fread() Function in C

Recent Posts

  • Machine Learning Experts You Should Be Following Online
  • 4 Ways to Prepare for the AP Computer Science A Exam
  • Finance Assignment Online Help for the Busy and Tired Students: Get Help from Experts
  • Top 9 Machine Learning Algorithms for Data Scientists
  • Data Science Learning Path or Steps to become a data scientist Final
  • Enable Edit Button in Shutter In Linux Mint 19 and Ubuntu 18.04
  • Python 3 time module
  • Pygments Tutorial
  • How to use Virtualenv?
  • Installing MySQL (Windows, Linux and Mac)
  • What is if __name__ == '__main__' in Python ?
  • Installing GoAccess (A Real-time web log analyzer)
  • Installing Isso

Codeforwin

Assignment and shorthand assignment operator in C

Quick links.

  • Shorthand assignment

Assignment operator is used to assign value to a variable (memory location). There is a single assignment operator = in C. It evaluates expression on right side of = symbol and assigns evaluated value to left side the variable.

For example consider the below assignment table.

The RHS of assignment operator must be a constant, expression or variable. Whereas LHS must be a variable (valid memory location).

Shorthand assignment operator

C supports a short variant of assignment operator called compound assignment or shorthand assignment. Shorthand assignment operator combines one of the arithmetic or bitwise operators with assignment operator.

For example, consider following C statements.

The above expression a = a + 2 is equivalent to a += 2 .

Similarly, there are many shorthand assignment operators. Below is a list of shorthand assignment operators in C.

C Data Types

C operators.

  • C Input and Output
  • C Control Flow
  • C Functions
  • C Preprocessors

C File Handling

  • C Cheatsheet

C Interview Questions

  • C Programming Language Tutorial
  • C Language Introduction
  • Features of C Programming Language
  • C Programming Language Standard
  • C Hello World Program
  • Compiling a C Program: Behind the Scenes
  • Tokens in C
  • Keywords in C

C Variables and Constants

  • C Variables
  • Constants in C
  • Const Qualifier in C
  • Different ways to declare variable as constant in C
  • Scope rules in C
  • Internal Linkage and External Linkage in C
  • Global Variables in C
  • Data Types in C
  • Literals in C
  • Escape Sequence in C
  • Integer Promotions in C
  • Character Arithmetic in C
  • Type Conversion in C

C Input/Output

  • Basic Input and Output in C
  • Format Specifiers in C
  • printf in C
  • Scansets in C
  • Formatted and Unformatted Input/Output functions in C with Examples

Operators in C

  • Arithmetic Operators in C
  • Unary operators in C
  • Relational Operators in C
  • Bitwise Operators in C
  • C Logical Operators
  • Assignment Operators in C
  • Increment and Decrement Operators in C
  • Conditional or Ternary Operator (?:) in C
  • sizeof operator in C

Operator Precedence and Associativity in C

C control statements decision-making.

  • Decision Making in C (if , if..else, Nested if, if-else-if )
  • C - if Statement
  • C if...else Statement
  • C if else if ladder
  • Switch Statement in C
  • Using Range in switch Case in C
  • while loop in C
  • do...while Loop in C
  • For Versus While
  • Continue Statement in C
  • Break Statement in C
  • goto Statement in C
  • User-Defined Function in C
  • Parameter Passing Techniques in C
  • Function Prototype in C
  • How can I return multiple values from a function?
  • main Function in C
  • Implicit return type int in C
  • Callbacks in C
  • Nested functions in C
  • Variadic functions in C
  • _Noreturn function specifier in C
  • Predefined Identifier __func__ in C
  • C Library math.h Functions

C Arrays & Strings

  • Properties of Array in C
  • Multidimensional Arrays in C
  • Initialization of Multidimensional Array in C
  • Pass Array to Functions in C
  • How to pass a 2D array as a parameter in C?
  • What are the data types for which it is not possible to create an array?
  • How to pass an array by value in C ?
  • Strings in C
  • Array of Strings in C
  • What is the difference between single quoted and double quoted declaration of char array?
  • C String Functions
  • Pointer Arithmetics in C with Examples
  • C - Pointer to Pointer (Double Pointer)
  • Function Pointer in C
  • How to declare a pointer to a function?
  • Pointer to an Array | Array Pointer
  • Difference between constant pointer, pointers to constant, and constant pointers to constants
  • Pointer vs Array in C
  • Dangling, Void , Null and Wild Pointers in C
  • Near, Far and Huge Pointers in C
  • restrict keyword in C

C User-Defined Data Types

  • C Structures
  • dot (.) Operator in C
  • Structure Member Alignment, Padding and Data Packing
  • Flexible Array Members in a structure in C
  • Bit Fields in C
  • Difference Between Structure and Union in C
  • Anonymous Union and Structure in C
  • Enumeration (or enum) in C

C Storage Classes

  • Storage Classes in C
  • extern Keyword in C
  • Static Variables in C
  • Initialization of static variables in C
  • Static functions in C
  • Understanding "volatile" qualifier in C | Set 2 (Examples)
  • Understanding "register" keyword in C

C Memory Management

  • Memory Layout of C Programs
  • Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()
  • Difference Between malloc() and calloc() with Examples
  • What is Memory Leak? How can we avoid?
  • Dynamic Array in C
  • How to dynamically allocate a 2D array in C?
  • Dynamically Growing Array in C

C Preprocessor

  • C Preprocessor Directives
  • How a Preprocessor works in C?
  • Header Files in C
  • What’s difference between header files "stdio.h" and "stdlib.h" ?
  • How to write your own header file in C?
  • Macros and its types in C
  • Interesting Facts about Macros and Preprocessors in C
  • # and ## Operators in C
  • How to print a variable name in C?
  • Multiline macros in C
  • Variable length arguments for Macros
  • Branch prediction macros in GCC
  • typedef versus #define in C
  • Difference between #define and const in C?
  • Basics of File Handling in C
  • C fopen() function with Examples
  • EOF, getc() and feof() in C
  • fgets() and gets() in C language
  • fseek() vs rewind() in C
  • What is return type of getchar(), fgetc() and getc() ?
  • Read/Write Structure From/to a File in C
  • C Program to print contents of file
  • C program to delete a file
  • C Program to merge contents of two files into a third file
  • What is the difference between printf, sprintf and fprintf?
  • Difference between getc(), getchar(), getch() and getche()

Miscellaneous

  • time.h header file in C with Examples
  • Input-output system calls in C | Create, Open, Close, Read, Write
  • Signals in C language
  • Program error signals
  • Socket Programming in C
  • _Generics Keyword in C
  • Multithreading in C
  • C Programming Interview Questions (2024)
  • Commonly Asked C Programming Interview Questions | Set 1
  • Commonly Asked C Programming Interview Questions | Set 2
  • Commonly Asked C Programming Interview Questions | Set 3

In C language, operators are symbols that represent operations to be performed on one or more operands. They are the basic components of the C programming. In this article, we will learn about all the built-in operators in C with examples.

What is a C Operator?

An operator in C can be defined as the symbol that helps us to perform some specific mathematical, relational, bitwise, conditional, or logical computations on values and variables. The values and variables used with operators are called operands. So we can say that the operators are the symbols that perform operations on operands.

Operators-in-C

For example,

Here, ‘+’ is the operator known as the addition operator, and ‘a’ and ‘b’ are operands. The addition operator tells the compiler to add both of the operands ‘a’ and ‘b’.

Types of Operators in C

C language provides a wide range of operators that can be classified into 6 types based on their functionality:

  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Bitwise Operators
  • Assignment Operators
  • Other Operators

1. Arithmetic Operations in C

The arithmetic operators are used to perform arithmetic/mathematical operations on operands. There are 9 arithmetic operators in C language:

Example of C Arithmetic Operators

2. relational operators in c.

The relational operators in C are used for the comparison of the two operands. All these operators are binary operators that return true or false values as the result of comparison.

These are a total of 6 relational operators in C:

Example of C Relational Operators

Here, 0 means false and 1 means true.

3. Logical Operator in C

Logical Operators are used to combine two or more conditions/constraints or to complement the evaluation of the original condition in consideration. The result of the operation of a logical operator is a Boolean value either true or false .

Example of Logical Operators in C

4. bitwise operators in c.

The Bitwise operators are used to perform bit-level operations on the operands. The operators are first converted to bit-level and then the calculation is performed on the operands. Mathematical operations such as addition, subtraction, multiplication, etc. can be performed at the bit level for faster processing.

There are 6 bitwise operators in C:

Example of Bitwise Operators

5. assignment operators in c.

Assignment operators are used to assign value to a variable. The left side operand of the assignment operator is a variable and the right side operand of the assignment operator is a value. The value on the right side must be of the same data type as the variable on the left side otherwise the compiler will raise an error.

The assignment operators can be combined with some other operators in C to provide multiple operations using single operator. These operators are called compound operators.

In C, there are 11 assignment operators :

Example of C Assignment Operators

6. other operators.

Apart from the above operators, there are some other operators available in C used to perform some specific tasks. Some of them are discussed here: 

sizeof Operator

  • sizeof is much used in the C programming language.
  • It is a compile-time unary operator which can be used to compute the size of its operand.
  • The result of sizeof is of the unsigned integral type which is usually denoted by size_t.
  • Basically, the sizeof the operator is used to compute the size of the variable or datatype.

To know more about the topic refer to this article.

Comma Operator ( , )

  • The comma operator (represented by the token) is a binary operator that evaluates its first operand and discards the result, it then evaluates the second operand and returns this value (and type).
  • The comma operator has the lowest precedence of any C operator.
  • Comma acts as both operator and separator. 

Conditional Operator ( ? : )

  • The conditional operator is the only ternary operator in C++.
  • Here, Expression1 is the condition to be evaluated. If the condition(Expression1) is True then we will execute and return the result of Expression2 otherwise if the condition(Expression1) is false then we will execute and return the result of Expression3.
  • We may replace the use of if..else statements with conditional operators.

dot (.) and arrow (->) Operators

  • Member operators are used to reference individual members of classes, structures, and unions.
  • The dot operator is applied to the actual object. 
  • The arrow operator is used with a pointer to an object.

To know more about dot operators refer to this article and to know more about arrow(->) operators refer to this article.

Cast Operator

  • Casting operators convert one data type to another. For example, int(2.2000) would return 2.
  • A cast is a special operator that forces one data type to be converted into another. 
  • The most general cast supported by most of the C compilers is as follows −   [ (type) expression ] .

addressof (&) and Dereference (*) Operators

  • Pointer operator & returns the address of a variable. For example &a; will give the actual address of the variable.
  • The pointer operator * is a pointer to a variable. For example *var; will pointer to a variable var. 

Example of Other C Operators

Unary, binary and ternary operators in c.

Operators can also be classified into three types on the basis of the number of operands they work on:

  • Unary Operators: Operators that work on single operand.
  • Binary Operators: Operators that work on two operands.
  • Ternary Operators: Operators that work on three operands.

In C, it is very common for an expression or statement to have multiple operators and in these expression, there should be a fixed order or priority of operator evaluation to avoid ambiguity.

Operator Precedence and Associativity is the concept that decides which operator will be evaluated first in the case when there are multiple operators present in an expression.

The below table describes the precedence order and associativity of operators in C. The precedence of the operator decreases from top to bottom. 

To know more about operator precedence and associativity, refer to this article – Operator Precedence and Associativity in C

In this article, the points we learned about the operator are as follows:

  • Operators are symbols used for performing some kind of operation in C.
  • There are six types of operators, Arithmetic Operators, Relational Operators, Logical Operators, Bitwise Operators, Assignment Operators, and Miscellaneous Operators.
  • Operators can also be of type unary, binary, and ternary according to the number of operators they are using.
  • Every operator returns a numerical value except logical, relational, and conditional operator which returns a boolean value (true or false).
  • There is a Precedence in the operators means the priority of using one operator is greater than another operator.

FAQs on C Operators

Q1. what are operators in c.

Operators in C are certain symbols in C used for performing certain mathematical, relational, bitwise, conditional, or logical operations for the user.

Q2. What are the 7 types of operators in C?

There are 7 types of operators in C as mentioned below: Unary operator Arithmetic operator Relational operator Logical operator Bitwise operator Assignment operator Conditional operator

Q3. What is the difference between the ‘=’ and ‘==’ operators?

‘=’ is a type of assignment operator that places the value in right to the variable on left, Whereas ‘==’ is a type of relational operator that is used to compare two elements if the elements are equal or not.

Q4. What is the difference between prefix and postfix operators in C?

In prefix operations, the value of a variable is incremented/decremented first and then the new value is used in the operation, whereas, in postfix operations first the value of the variable is used in the operation and then the value is incremented/decremented. Example: b=c=10; a=b++; // a==10 a=++c; // a==11

Q5. What is the Modulo operator?

The Modulo operator(%) is used to find the remainder if one element is divided by another. Example: a % b (a divided by b) 5 % 2 == 1

Please Login to comment...

Similar reads.

  • C-Operators

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Programtopia

C Programming Operators and Expressions

In this Section, you will learn about Operators in C Programming (all valid operators available in C), expressions (combination of operators, variables and constants) and precedence of operators (which operator has higher priority and which operator has lower priority).

C Operators

  • Expressions in C
  • C Operator Precedence

Operators are the symbols which tell the computer to execute certain mathematical or logical operations. A mathematical or logical expression is generally formed with the help of an operator. C programming offers a number of operators which are classified into 8 categories viz.

  • Arithmetic operators
  • Relational operators
  • Logical operators
  • Assignment operators
  • Increment and Decrement operators
  • Conditional operators
  • Bitwise operators
  • Special operators

1. Arithmetic Operators

C programming language provides all basic arithmetic operators: +, -, *, / and %.

Arithmetic Operators in C

Note: ‘/’ is integer division which only gives integer part as result after division. ‘%’ is modulo division which gives the remainder of integer division as result.

Some examples of arithmetic operators are:

In these examples, a and b are variables and are called operands.

Note: ‘%’ cannot be used on floating data type.

2. Relational Operators

Relational operators are used when we have to make comparisons. C programming offers 6 relational operators.

Relational Operators in C

Relational expression is an expression which contains the relational operator. Relational operators are most commonly used in decision statements like if , while , etc. Some simple relational expressions are:

Note: Arithmetic operators have higher priority than relational operators meaning that if arithmetic expressions are present on two sides of a relational operator then arithmetic expressions will be calculated first and then the result will be compared.

3. Logical Operators

Logical operators are used when more than one conditions are to be tested and based on that result, decisions have to be made. C programming offers three logical operators. They are:

Logical Operators in C

For example:

An expression which combines two or more relational expressions is known as logical expression.

Note: Relative precedence of relational and logical operators are as follows

4. Assignment Operators

Assignment operators are used to assign result of an expression to a variable. ‘=’ is the assignment operator in C. Furthermore, C also allows the use of shorthand assignment operators. Shorthand operators take the form:

where var is a variable, op is arithmetic operator, exp is an expression. In this case, ‘op=’ is known as shorthand assignment operator.

The above assignment

is the same as the assignment

Consider an example:

Here, the above statement means the same as

Note: Shorthand assignment can be used with all arithmetic operators.

5. Increment and Decrement Operators

C programming allows the use of ++ and – operators which are increment and decrement operators respectively. Both the increment and decrement operators are unary operators. The increment operator ++ adds 1 to the operand and the decrement operator – subtracts 1 from the operand. The general syntax of these operators are:

Increment Operator: m++ or ++m ;

Decrement Operator: m–or –m ;

In the example above, m++ simply means m=m+1; and m– simply means m=m-1;

Increment and decrement operators are mostly used in for and while loops.

++m and m++ performs the same operation when they form statements independently but they function differently when they are used in right hand side of an expression.

++m is known as prefix operator and m++ is known as postfix operator. A prefix operator firstly adds 1 to the operand and then the result is assigned to the variable on the left whereas a postfix operator firstly assigns value to the variable on the left and then increases the operand by 1. Same is in the case of decrement operator.

For example,

X=10; Y=++X;

In this case, the value of X and Y will be 6.

In this case, the value of Y will be 10 and the value of X will be 11.

6. Conditional Operator

The operator pair “?” and “:” is known as conditional operator. These pair of operators are ternary operators. The general syntax of conditional operator is:

This syntax can be understood as a substitute of if else statement.

Consider an if else statement as:

Now, this if else statement can be written by using conditional operator as:

7. Bitwise Operator

In C programming, bitwise operators are used for testing the bits or shifting them left or right. The bitwise operators available in C are:

Bitwise Operators in C

8. Special Operators

C programming supports special operators like comma operator, sizeof operator, pointer operators (& and *) and member selection operators (. and ->). The comma operator and sizeof operator are discussed in this section whereas the pointer and member selection operators are discussed in later sections.

1. Comma Operator

The comma operator can be used to link the related expressions together. A comma linked expression is evaluated from left to right and the value of the right most expression is the value of the combined expression.

In this example, the expression is evaluated from left to right. So at first, variable a is assigned value 2, then variable b is assigned value 4 and then value 6 is assigned to the variable x. Comma operators are commonly used in for loops, while loops, while exchanging values, etc.

2 .Sizeof() operator

The sizeof operator is usually used with an operand which may be variable, constant or a data type qualifier. This operator returns the number of bytes the operand occupies. Sizeof operator is a compile time operator. Some examples of use of sizeof operator are:

The sizeof operator is usually used to determine the length of arrays and structures when their sizes are not known. It is also used in dynamic memory allocation.

9. C Expressions

Arithmetic expression in C is a combination of variables, constants and operators written in a proper syntax. C can easily handle any complex mathematical expressions but these mathematical expressions have to be written in a proper syntax. Some examples of mathematical expressions written in proper syntax of C are:

Note: C does not have any operator for exponentiation.

10. C Operator Precedence

At first, the expressions within parenthesis are evaluated. If no parenthesis is present, then the arithmetic expression is evaluated from left to right. There are two priority levels of operators in C.

High priority: * / % Low priority: + –

The evaluation procedure of an arithmetic expression includes two left to right passes through the entire expression. In the first pass, the high priority operators are applied as they are encountered and in the second pass, low priority operations are applied as they are encountered.

Suppose, we have an arithmetic expression as:

This expression is evaluated in two left to right passes as:

But when parenthesis is used in the same expression, the order of evaluation gets changed.

When parentheses are present then the expression inside the parenthesis are evaluated first from left to right. The expression is now evaluated in three passes as:

Second Pass

There may even arise a case where nested parentheses are present (i.e. parenthesis inside parenthesis). In such case, the expression inside the innermost set of parentheses is evaluated first and then the outer parentheses are evaluated.

For example, we have an expression as:

The expression is now evaluated as:

First Pass:

Note: The number of evaluation steps is equal to the number of operators in the arithmetic expression.

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Assignment operators (C# reference)

  • 11 contributors

The assignment operator = assigns the value of its right-hand operand to a variable, a property , or an indexer element given by its left-hand operand. The result of an assignment expression is the value assigned to the left-hand operand. The type of the right-hand operand must be the same as the type of the left-hand operand or implicitly convertible to it.

The assignment operator = is right-associative, that is, an expression of the form

is evaluated as

The following example demonstrates the usage of the assignment operator with a local variable, a property, and an indexer element as its left-hand operand:

The left-hand operand of an assignment receives the value of the right-hand operand. When the operands are of value types , assignment copies the contents of the right-hand operand. When the operands are of reference types , assignment copies the reference to the object.

This is called value assignment : the value is assigned.

ref assignment

Ref assignment = ref makes its left-hand operand an alias to the right-hand operand, as the following example demonstrates:

In the preceding example, the local reference variable arrayElement is initialized as an alias to the first array element. Then, it's ref reassigned to refer to the last array element. As it's an alias, when you update its value with an ordinary assignment operator = , the corresponding array element is also updated.

The left-hand operand of ref assignment can be a local reference variable , a ref field , and a ref , out , or in method parameter. Both operands must be of the same type.

Compound assignment

For a binary operator op , a compound assignment expression of the form

is equivalent to

except that x is only evaluated once.

Compound assignment is supported by arithmetic , Boolean logical , and bitwise logical and shift operators.

Null-coalescing assignment

You can use the null-coalescing assignment operator ??= to assign the value of its right-hand operand to its left-hand operand only if the left-hand operand evaluates to null . For more information, see the ?? and ??= operators article.

Operator overloadability

A user-defined type can't overload the assignment operator. However, a user-defined type can define an implicit conversion to another type. That way, the value of a user-defined type can be assigned to a variable, a property, or an indexer element of another type. For more information, see User-defined conversion operators .

A user-defined type can't explicitly overload a compound assignment operator. However, if a user-defined type overloads a binary operator op , the op= operator, if it exists, is also implicitly overloaded.

C# language specification

For more information, see the Assignment operators section of the C# language specification .

  • C# operators and expressions
  • ref keyword
  • Use compound assignment (style rules IDE0054 and IDE0074)

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

cppreference.com

C operator precedence.

The following table lists the precedence and associativity of C operators. Operators are listed top to bottom, in descending precedence.

  • ↑ The operand of prefix ++ and -- can't be a type cast. This rule grammatically forbids some expressions that would be semantically invalid anyway. Some compilers ignore this rule and detect the invalidity semantically.
  • ↑ The operand of sizeof can't be a type cast: the expression sizeof ( int ) * p is unambiguously interpreted as ( sizeof ( int ) ) * p , but not sizeof ( ( int ) * p ) .
  • ↑ The expression in the middle of the conditional operator (between ? and : ) is parsed as if parenthesized: its precedence relative to ?: is ignored.
  • ↑ Assignment operators' left operands must be unary (level-2 non-cast) expressions. This rule grammatically forbids some expressions that would be semantically invalid anyway. Many compilers ignore this rule and detect the invalidity semantically. For example, e = a < d ? a ++ : a = d is an expression that cannot be parsed because of this rule. However, many compilers ignore this rule and parse it as e = ( ( ( a < d ) ? ( a ++ ) : a ) = d ) , and then give an error because it is semantically invalid.

When parsing an expression, an operator which is listed on some row will be bound tighter (as if by parentheses) to its arguments than any operator that is listed on a row further below it. For example, the expression * p ++ is parsed as * ( p ++ ) , and not as ( * p ) ++ .

Operators that are in the same cell (there may be several rows of operators listed in a cell) are evaluated with the same precedence, in the given direction. For example, the expression a = b = c is parsed as a = ( b = c ) , and not as ( a = b ) = c because of right-to-left associativity.

[ edit ] Notes

Precedence and associativity are independent from order of evaluation .

The standard itself doesn't specify precedence levels. They are derived from the grammar.

In C++, the conditional operator has the same precedence as assignment operators, and prefix ++ and -- and assignment operators don't have the restrictions about their operands.

Associativity specification is redundant for unary operators and is only shown for completeness: unary prefix operators always associate right-to-left ( sizeof ++* p is sizeof ( ++ ( * p ) ) ) and unary postfix operators always associate left-to-right ( a [ 1 ] [ 2 ] ++ is ( ( a [ 1 ] ) [ 2 ] ) ++ ). Note that the associativity is meaningful for member access operators, even though they are grouped with unary postfix operators: a. b ++ is parsed ( a. b ) ++ and not a. ( b ++ ) .

[ edit ] References

  • C17 standard (ISO/IEC 9899:2018):
  • A.2.1 Expressions
  • C11 standard (ISO/IEC 9899:2011):
  • C99 standard (ISO/IEC 9899:1999):
  • C89/C90 standard (ISO/IEC 9899:1990):
  • A.1.2.1 Expressions

[ edit ] See also

Order of evaluation of operator arguments at run time.

  • Recent changes
  • Offline version
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link
  • Page information
  • In other languages
  • This page was last modified on 31 July 2023, at 09:28.
  • This page has been accessed 2,665,989 times.
  • Privacy policy
  • About cppreference.com
  • Disclaimers

Powered by MediaWiki

Assignment Statement in C

How to assign values to the variables? C provides an  assignment operator  for this purpose, assigning the value to a variable using assignment operator is known as an assignment statement in C.

The function of this operator is to assign the values or values in variables on right hand side of an expression to variables on the left hand side.

The syntax of the  assignment expression

Variable = constant / variable/ expression;

The data type of the variable on left hand side should match the data type of constant/variable/expression on right hand side with a few exceptions where automatic type conversions are possible.

Examples of assignment statements,

b = c ; /* b is assigned the value of c */ a = 9 ; /* a is assigned the value 9*/ b = c+5; /* b is assigned the value of expr c+5 */

The expression on the right hand side of the assignment statement can be:

An arithmetic expression; A relational expression; A logical expression; A mixed expression.

The above mentioned expressions are different in terms of the type of operators connecting the variables and constants on the right hand side of the variable. Arithmetic operators, relational

Arithmetic operators, relational operators and logical operators are discussed in the following sections.

For example, int a; float b,c ,avg, t; avg = (b+c) / 2; /*arithmetic expression */ a = b && c; /*logical expression*/ a = (b+c) && (b<c); /* mixed expression*/

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related Posts

  • #define to implement constants
  • Preprocessor in C Language
  • Pointers and Strings

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Notify me of follow-up comments by email.

Notify me of new posts by email.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

Adobe Community

  • Global community
  • 日本語コミュニティ Dedicated community for Japanese speakers
  • 한국 커뮤니티 Dedicated community for Korean speakers
  • After Effects
  • Discussions
  • Re: Help with Time Remap expression

Help with Time Remap expression

Constantine36915682c55l

Copy link to clipboard

1 Correct answer

Dan Ebberts

never-displayed

  • Find & Reserve
  • Special Offers
  • Meetings & Events
  • Our Credit Cards
  • About Marriott Bonvoy
  • Careers at Marriott

c assignment expression

ITC Ratnadipa, a Luxury Collection Hotel, Colombo

  • Accommodations
  • Experiences

Exterior at night

Welcome to ITC Ratnadipa, a Luxury Collection Hotel, Colombo

A living cultural expression of colombo, sri lanka.

For those who yearn to not just discover Sri Lanka, but to embrace it, to dive beneath the surface, to explore like a local, ITC Ratnadipa A Luxury Collection Hotel awaits. Nestled between the Indian Ocean and Beira Lake in the capital city of Colombo, our 5-star hotel promises an extraordinary experience. Indulge in luxury within our 352 rooms and suites, each with private balconies offering stunning water views. Avartana, our fine dining restaurant, stands proudly as one of Asia's top 50 restaurants. Ascend to new heights on the Sky Bridge, suspended 100 meters above the ground, featuring two pools that unveil stunning panoramas of the Indian Ocean and Beira Lake. Host signature gatherings in 15,000 sq.ft. of pillarless event space with floor-to-ceiling windows. As the sun sets, Ahasa Bar at the Sky Bridge becomes Colombos premier destination for sundowners. The pinnacle of VIP luxury, our Grand Presidential Suite boasts its own helipad, ensuring an unparalleled experience that transcends expectations.

Rooms & Suites

Featured amenities on-site, hotel information.

Check-in: 3:00 pm

Check-out: 12:00 pm

Smoke Free Property

Pets Not Allowed

Complimentary On-Site Parking

Complimentary Valet Parking

Indian Ocean Pavilion

Embark on a culinary odyssey at the Indian Ocean Pavilion, a paradise with seven cuisine theaters, each curated by culinary specialists, offering a symphony of flavors and choices.

Experience the award-winning Peshawri, a culinary journey bringing long-forgotten flavors of the North-West frontier to your table, where authenticity and excellence meet.

Elevate your dining experience at Avartana, a ground-breaking brand reinventing Southern Indian cuisine with a touch of local flair, credited with taking Indian cuisine to global acclaim.

Immerse yourself in a symphony of Asian culinary traditions at Yi Jing, where master chefs skillfully craft handmade noodles and present intricately handcrafted dim sum at live cooking stations.

Jala Anganaya

Delight in the relaxing ambiance of Jala Anganaya, a unique pool bar on the 4th level, serving guests healthy snacks and fresh juices in a serene poolside setting.

Indulge your senses at Ahasa, suspended 100 meters above, with handcrafted cocktails and breathtaking ocean views, destined to be the hotspot in Colombo for discerning connoisseurs.

Transport yourself to the ambiance of a Scottish tea planter's bar at Silvertips, serving the finest beverages and Ceylon teas in an elegant setting.

Step into a world of elegance at the Oyster Bar, where opulence awaits.

More Ways to Enjoy Your Stay

Kaya Kalp - The Spa

Kaya Kalp - The Royal Spa

Find tranquility at the Royal Spa, where signature Ayurvedic treatments and traditional spa experiences await. Immerse yourself in Sri Lanka's rich cultural tapestry through pampering massages, including Swedish and Thai techniques, with a local twist.

Fitness Centre

Fitness Center

Achieve your fitness goals at our state-of-the-art fitness centre spanning stunning ocean views.

GETTING HERE

21 Galle Face Centre Rd, Colombo, Sri Lanka, 00100

Bus Station

Galle Face Bus stop

Train Station

Fort Railway station

Property Details

Accepts: Credit Cards

Concierge desk service

Property has elevators

Languages spoken by staff: English, Tamil, Hindi

For more information about the physical features of our accessible rooms, common areas or special services relating to a specific disability please call +94 11-4999111

Self Operating lift or a sloped entry in hotel swimming pools

Accessible Entrance to On-Site Pool

Entrance to On-Site Business Center is Accessible

Entrance to On-Site Fitness Center is Accessible

Entrance to On-Site Spa is Accessible

Main Entrance is Accessible

Meeting Spaces are Accessible

On-Site Restaurants are Accessible

Room and Suites Access through the Interior Corridor

Accessible Vanities

Deadbolts on Guest Room and Suites Doors

Electronic Room Key

Mobility accessible rooms

Non-slip Grab Rails in the Bathroom

Roll-in Shower

Room Windows Open

Secondary Locks on Room Windows

Toilet Seat at Wheelchair Height - Toilet for Disabled

Frequently Asked Questions

The check-in time at ITC Ratnadipa, a Luxury Collection Hotel, Colombo is 3:00 pm and the check-out time is 12:00 pm.

The pet policy at ITC Ratnadipa, a Luxury Collection Hotel, Colombo is:

The parking options at ITC Ratnadipa, a Luxury Collection Hotel, Colombo are:

The property amenities at ITC Ratnadipa, a Luxury Collection Hotel, Colombo are:

Yes, ITC Ratnadipa, a Luxury Collection Hotel, Colombo has free Wi-Fi available to hotel guests.

Unlock your stay with the Marriott Bonvoy™ App

ITC RATNADIPA, A LUXURY COLLECTION HOTEL, COLOMBO

21 Galle Face Centre Rd,

Colombo, Sri Lanka, 00100

ROOM RESERVATIONS PHONE NUMBER: +94 11-4999111

Fax: +94 11-4999100

Top Destinations

Our company.

© 1996 – 2024 Marriott International, Inc. All rights reserved. Marriott Proprietary Information

Please select your preferred language

The americas, asia and oceania.

  • Bahasa Indonesia

INTERNATIONAL

  • Election 2024
  • Entertainment
  • Newsletters
  • Photography
  • Personal Finance
  • AP Investigations
  • AP Buyline Personal Finance
  • AP Buyline Shopping
  • Press Releases
  • Israel-Hamas War
  • Russia-Ukraine War
  • Global elections
  • Asia Pacific
  • Latin America
  • Middle East
  • Election Results
  • Delegate Tracker
  • AP & Elections
  • Auto Racing
  • 2024 Paris Olympic Games
  • Movie reviews
  • Book reviews
  • Personal finance
  • Financial Markets
  • Business Highlights
  • Financial wellness
  • Artificial Intelligence
  • Social Media

Judge dismisses lawsuit by mother who said school hid teen’s gender expression

FILE - In this photograph provided by Stephen Davis Phillips/Goldwater Institute, Amber Lavigne, of Newcastle, Maine, poses on March 25, 2023, at her home in Newcastle. A federal judge dismissed a lawsuit brought by the Maine woman who accused school officials of encouraging her teen’s gender expression by providing a chest binder and using a new name and pronouns, without consulting parents. (Stephen Davis Phillips/Goldwater Institute via AP)

FILE - In this photograph provided by Stephen Davis Phillips/Goldwater Institute, Amber Lavigne, of Newcastle, Maine, poses on March 25, 2023, at her home in Newcastle. A federal judge dismissed a lawsuit brought by the Maine woman who accused school officials of encouraging her teen’s gender expression by providing a chest binder and using a new name and pronouns, without consulting parents. (Stephen Davis Phillips/Goldwater Institute via AP)

  • Copy Link copied

PORTLAND, Maine (AP) — A federal judge dismissed a lawsuit brought by a Maine woman who accused school officials of encouraging her teen’s gender expression by providing a chest binder and using a new name and pronouns, without consulting parents.

U.S. District Judge Jon Levy acknowledged his decision that a mother such as Amber Lavigne “might expect school officials to keep her informed about how her child is navigating matters related to gender identity” but he concluded that she failed to establish legal claims for which the school district could be held liable.

The lawsuit filed last year was the latest to weigh a minor’s right to privacy when confiding in a mental health professional against a parent’s right to supervise their children’s health and education.

According to the lawsuit, a school counselor provided the chest binder and instruction on how to use it. The mother, who has since begun home-schooling her teen, said the school also began calling the 13-year-old by a different name and pronouns.

The lawsuit contended the mother had a “right to control and direct the care, custody, education, upbringing and healthcare decisions of her children,” and that Great Salt Bay Community School in Damariscotta violated her constitutional right by keeping the student’s gender expression from parents.

The judge previously dismissed claims against individual school officials. The remaining claim against the school board was dismissed by the judge in his May 3 order.

c assignment expression

c assignment expression

Refactor your code with C# collection expressions

c assignment expression

May 8th, 2024 7 8

This post is the second in a series of posts covering various refactoring scenarios that explore C# 12 features. In this post, we’ll look at how you can refactor your code using collection expressions, we’ll learn about collection initializers, various expression usages, supported collection target types, and the spread syntax. Here’s how the series is shaping up:

  • Refactor your C# code with primary constructors
  • Refactor your C# code with collection expressions (this post)
  • Refactor your C# code by aliasing any type
  • Refactor your C# code to use default lambda parameters

These features continue our journey to make our code more readable and maintainable, and these are considered “Everyday C#” features that developers should know.

Collection Expressions 🎨

C# 12 introduced collection expressions that offer a simple and consistent syntax across many different collection types. When initializing a collection with a collection expression, the compiler generates code that is functionally equivalent to using a collection initializer. The feature emphasizes consistency , while allowing for the compiler to optimize the lowered C#. Of course, every team decides what new features to adopt, and you can experiment and introduce this new syntax if you like it, since all of the previous ways to initialize collections will continue to work.

With collections expressions elements appear inlined sequences of elements between an opening [ and closing ] bracket. Read on to hear more about how collection expressions work.

Initialization 🌱

C# provides many syntaxes for initializing different collections. Collection expressions replace all of these, so let’s start with a look at different ways you can initialize an array of integers like this:

All four versions are functionally equivalent, and the compiler generates identical code for each version. The last example is similar to the new collection expressions syntax. If you squint your eyes a bit, you could imagine the curly braces as { and } as square brackets [ and ] , then you’d be reading the new collection expression syntax. Collection expressions don’t use curly braces. This is to avoid ambiguity with existing syntax, especially { } to indicate any not-null in patterns.

The last example is the only to declare the type explicitly, instead of relying on var . The following example creates a List<char> :

Again, collection expressions cannot be used with the var keyword. You must declare the type because a collection expression doesn’t currently have a natural type and can be converted to a wide variety of collection types . Supporting assignment to var is still under consideration, but the team has not settled on the what the natural type should be. In other words, the C# compiler errors out with CS9176: There is no target type for the collection expression, when writing the following code:

You might be asking yourself, “with all these different approaches to initializing collections, why would I use the new collection expression syntax?” The answer is that with collection expressions, you can use the same syntax to express collections in a consistent way. This can help to make your code more readable and maintainable. We’ll explore more advantages in the coming sections.

Collection expression variations 🎭

You can express that a collection is empty , using the following syntax:

The empty collection expression initialization is a great replacement for code that was otherwise using the new keyword, as it’s optimized by the compiler to avoid allocating memory for some collection types. For example, when the collection type is an array T[] , the compiler generates an Array.Empty<T>() , which is more efficient than new int[] { } . Another shortcut is to use the number of elements in the collection expression to set the collection size, such as new List<int>(2) for List<T> x = [1, 2]; .

Collection expressions also allow you to assign to interfaces without stating an explicit type. The compiler determines the type to use for types, such as IEnumerable<T> , IReadOnlyList<T> , and IReadOnlyCollection<T> . If the actual type used is important, you’ll want to state it because this may change if more efficient types become available. Likewise, in situations where the compiler cannot generate more efficient code, for example when the collection type is a List<T> , the compiler generates a new List<int>() , which is then equivalent.

The advantages of using the empty collection expression are threefold:

  • It provides a consistent means of initializing all collections, regardless of their target type.
  • It allows the compiler to generate efficient code.
  • It’s less code to write. For example, instead of writing Array.Empty<T>() or Enumerable.Empty<T>() , you can simply write [] .

A few more details about the efficient generated code: using the [] syntax generates known IL. This allows the runtime to optimize by reusing the storage for Array.Empty<T> (for each T ), or even more aggressively inline the code.

Empty collections serve their purpose, but you may need a collection that has some initial values. You can initialize a collection with a single element, using the following syntax:

Initializing a single element collection is similar to initializing a collection with more than a single element. You can initialize a collection with multiple elements by adding other literal values, using the following syntax:

A bit of history

Let’s look at another code sample, but this uses spread element , to include the elements of another collection, using the following syntax:

The spread element is a powerful feature that allows you to include the elements of another collection in the current collection. The spread element is a great way to combine collections in a concise way. The expression in a spread element must be enumerable ( foreach -able). For more information, see the Spread ✨ section.

Supported collection types 🎯

There are many target types that collection expressions can be used with. The feature recognizes the “shape” of a type that represents a collection. Therefore, most collections you’re familiar with are supported out-of-the-box. For types that don’t match that “shape” (mostly readonly collections), there are attributes you can apply to describe the builder pattern. The collection types in the BCL that needed the attributes/builder pattern approaches, have already been updated.

It’s unlikely that you’ll ever need to think about how target types are selected, but if you are curious about the rules see the C# Language Reference: Collection expressions—conversions .

Collection expressions don’t yet support dictionaries. You can find a proposal to extend the feature C# Feature Proposal: Dictionary expressions .

Refactoring scenarios 🛠️

Collection expressions can be useful in many scenarios, such as:

  • properties.
  • local variables.
  • method parameters.
  • return values.
  • a coalescing expression as the final fallthrough to safely avoid exceptions.
  • Passing arguments to methods that expect collection type parameters.

Let’s use this section to explore some sample usage scenarios, and consider potential refactoring opportunities. When you define a class or struct that contains fields and/or properties with non-nullable collection types, you can initialize them with collection expressions. For example, consider the following example ResultRegistry object:

In the preceding code, the result registry class contains a private _results field that is initialized with a new HashSet<Result>() constructor expression. In your IDE of choice (that supports these refactoring features), right-click on the new keyword, select Quick Actions and Refactorings... (or press Ctrl + . ), and choose Collection initialization can be simplified , as shown in the following video:

The code is updated to use the collection expression syntax, as shown in the following code:

The previous code, instantiated the HashSet<Result> with the new HashSet<Result>() constructor expression. However, in this case [] is identical.

Many popular programming languages such as Python and JavaScript/TypeScript, among others provide their variation of the spread syntax, which serves as a succinct way to work with collections. In C#, the spread element is the syntax used to express the concatenation of various collections into a single collection.

Proper terminology

So what exactly is spread element ? It takes the individual values from the collection being “spread” and places them in the destination collection at that position. The spread element functionality also comes with a refactoring opportunity. If you have code that calls .ToList or .ToArray , or you want to use eager evaluation, your IDE might be suggesting to use the spread element syntax instead. For example, consider the following code:

The preceding code could be refactored to use the spread element syntax, consider the following code that removes the .ToList method call, and uses an expression-bodied method as a bonus refactored version:

Span<T> and ReadOnlySpan<T> support 📏

Collection expressions support Span<T> and ReadOnlySpan<T> types that are used to represent a contiguous region of arbitrary memory. You benefit from the performance improvements they offer, even if you don’t use them directly in your code. Collection expressions allow the runtime to offer optimizations, especially where overloads using span can be selected when collection expressions are used as arguments.

You can also assign directly to span, if your application uses spans:

If you’re using the stackalloc keyword, there’s even a provided refactoring to use collection expressions. For example, consider the following code:

If you right-click on the stackalloc keyword, select Quick Actions and Refactorings... (or press Ctrl + . ), and choose Collection initialization can be simplified , as shown in the following video:

https://devblogs.microsoft.com/dotnet/wp-content/uploads/sites/10/2024/05/refactor-collection-ex.mp4

For more information, see Memory<T> and Span<T> usage guidelines .

Semantic considerations ⚙️

When initializing a collection with a collection expression, the compiler generates code that is functionally equivalent to using a collection initializer. Sometimes the generated code is much more efficient than using a collection initializer. Consider the following example:

The rules for a collection initializer require that the compiler call the Add method for each element in the initializer. However, if you’re to use the collection expression syntax:

The compiler generates code that instead uses AddRange , that might be faster or better optimized. The compiler is able to make these optimizations because it knows the target type of the collection expression.

Next steps 🚀

Be sure to try this out in your own code! Check back soon for the next post in this series, where we’ll explore how to refactor your C# code by aliasing any type. In the meantime, you can learn more about collection expressions in the following resources:

  • C# Feature Proposal: Collection expressions
  • C# Language Reference: Collection expressions
  • C# Docs: Collections

c assignment expression

David Pine Senior Content Developer, .NET

c assignment expression

Leave a comment Cancel reply

Log in to join the discussion or edit/delete existing comments.

This is all extremely nice!

This is a neat implementation of the Collection expression.

IMHO this is the annoying part of the feature Again, collection expressions cannot be used with the var keyword.

hope this will be addressed sooner then later, and if that’s all the reason behind it but the team has not settled on the what the natural type should be.

roll a dice if you can’t make up your mind. Or put up a poll and let majority decide.

I disagree. var support is not needed.

If anyone is wondering, the question is which is the correct choice when var is used: a) Default to the fastest and most efficient, such as Span or ReadOnlySpan b) Default to the one with the best developer experience, such as List

You can argue both cases, so it is just hard for everyone to reach agreement here.

Love or hate the collection expressions, but the use of emojis here is world class.

Regarding the LINQ example with the spread operator: does use of the collection expression result in the same call to .ToList() or is there some additional optimization going on? The original code could have been written as expression-bodied member as well, without declaring a local variable, so the new syntax isn’t much shorter and arguably the intent isn’t really clearer either. I wouldn’t use collection expressions in that case, unless perhaps it’s more efficient – hence the question.

(that aside, a very useful feature! the spread operator will replace a bunch of help methods in our code that were used to combine individual items and lists into a single list in an efficient manner, glad to let the compiler do that now)

light-theme-icon

Insert/edit link

Enter the destination URL

Or link to existing content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • View all journals
  • My Account Login
  • Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • Open access
  • Published: 06 November 2023

Integrated vector genomes may contribute to long-term expression in primate liver after AAV administration

  • Jenny A. Greig 1   na1 ,
  • Kelly M. Martins 1   na1 ,
  • Camilo Breton 1 ,
  • R. Jason Lamontagne   ORCID: orcid.org/0000-0002-9068-3348 1 ,
  • Yanqing Zhu 1 ,
  • Zhenning He 1 ,
  • John White 1 ,
  • Jing-Xu Zhu 1 ,
  • Jessica A. Chichester   ORCID: orcid.org/0000-0001-7879-120X 1 ,
  • Qi Zheng   ORCID: orcid.org/0000-0002-2582-1222 1 ,
  • Zhe Zhang 1 ,
  • Peter Bell 1 ,
  • Lili Wang   ORCID: orcid.org/0000-0001-9347-3939 1 &
  • James M. Wilson   ORCID: orcid.org/0000-0002-9630-3131 1  

Nature Biotechnology ( 2023 ) Cite this article

16k Accesses

7 Citations

49 Altmetric

Metrics details

  • Genetics research
  • Translational research

The development of liver-based adeno-associated virus (AAV) gene therapies is facing concerns about limited efficiency and durability of transgene expression. We evaluated nonhuman primates following intravenous dosing of AAV8 and AAVrh10 vectors for over 2 years to better define the mechanism(s) of transduction that affect performance. High transduction of non-immunogenic transgenes was achieved, although expression declined over the first 90 days to reach a lower but stable steady state. More than 10% of hepatocytes contained single nuclear domains of vector DNA that persisted despite the loss of transgene expression. Greater reductions in vector DNA and RNA were observed with immunogenic transgenes. Genomic integration of vector sequences, including complex concatemeric structures, were detected in 1 out of 100 cells at broadly distributed loci that were not in proximity to genes associated with hepatocellular carcinoma. Our studies suggest that AAV-mediated transgene expression in primate hepatocytes occurs in two phases: high but short-lived expression from episomal genomes, followed by much lower but stable expression, likely from integrated vectors.

Similar content being viewed by others

c assignment expression

Characterization of integration frequency and insertion sites of adenovirus DNA into mouse liver genomic DNA following intravenous injection

c assignment expression

Utility of microminipigs for evaluating liver-mediated gene expression in the presence of neutralizing antibody against vector capsid

c assignment expression

A humanized mouse model for adeno-associated viral gene therapy

Adeno-associated virus (AAV) gene therapies directed to the liver have been approved for hemophilia A and B, and there are many AAV treatments in late-stage clinical development 1 , 2 . However, concerns regarding the durability of AAV gene therapies in the liver, along with the challenge of re-administration, have raised questions about its ultimate utility 3 , 4 , 5 , 6 , 7 , 8 . Clinical studies of AAV-based liver gene therapy have demonstrated reductions in efficacy within the first 2 months of treatment 9 , 10 . Correlations between the appearance of capsid-directed T cells, serum transaminase elevations and reductions of factor IX in hemophilia B trials implicate immune responses in the lack of durability 9 . An immediate reduction in serum bilirubin was observed following AAV gene therapy in an individual with Crigler–Najjar syndrome. However, serum bilirubin returned to pre-treatment levels within 2 months without apparent vector immunity or liver inflammation, suggesting that a non-immune mechanism may lead to loss of efficacy 10 . Following an initial period of expression instability lasting several months, expression appears to be remarkably consistent, albeit at low levels, in both nonhuman primates (NHPs) and humans, which is surprising because the constant turnover of hepatocytes should dilute the episomal AAV genome 11 .

AAV gene therapy is efficient but does not persist at high levels in NHP liver

The goal of our study was to define the mechanism(s) that limit efficient and durable transgene expression following liver gene therapy with AAV vectors. Previous studies with complete preclinical and clinical datasets suggest that NHPs are better suited for evaluating key aspects of vector performance than other animal models 9 , 10 , 12 , 13 , 14 , 15 , 16 . We conducted initial studies in rhesus macaques using macaque-derived β-choriogonadotropic hormone (rh-β-CG; CGB ) as the transgene. rh-β-CG is secreted and has a short serum half-life, meaning it can provide a longitudinal, real-time readout of transgene transcription. As rh-β-CG should be viewed as a self-protein in macaques, confounding adaptive immune responses to the transgene product or to transgene-expressing cells are unlikely. We evaluated two clade E capsids that have been used in multiple clinical trials, AAV8 and AAVrh10 ( n  = 6 NHPs per vector). As an essential and unique aspect of our studies, we analyzed three sequential liver tissue samples from each animal by biopsy at days 14 and 98 and at necropsy at day 182. These analyses included assessment of transgene DNA and RNA by quantitative PCR (qPCR) and cellular distribution of DNA and rh-β-CG protein expression by in situ hybridization (ISH) and immunohistochemistry (IHC), respectively.

We observed similar levels and profiles of rh-β-CG protein expression in serum for each capsid; peak levels were achieved by day 7, followed by a gradual decline to stable levels three- to sixfold lower than the peak (Fig. 1a ) without transaminase elevations (Fig. 1b ). Statistically significant reductions in total vector DNA and RNA occurred over time, although the magnitude of reduction was smaller for DNA than for RNA. Although DNA levels decreased further over the two later time points, RNA levels were stable between days 98 and 182 after the initial decline relative to day 14 (Fig. 1c,d ).

figure 1

a , b , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 or AAVrh10 vectors expressing the self-transgene rh-β-CG ( n  = 6 per group). Serum rh-β-CG levels were evaluated throughout the in-life phase for transgene expression ( a ) as well as alanine aminotransferase (ALT) levels ( b ). Liver tissue was collected during a liver biopsy procedure (14 or 98 days after vector administration) or at the time of necropsy (182 days after vector administration). c , d , DNA ( c ) and RNA ( d ) were extracted from liver samples to evaluate the number of vector genome copies (GC) and transgene RNA levels, respectively. e – j , IHC for rh-β-CG protein was performed on liver samples (brown staining) from animals administered AAV8 ( e – g ) or AAVrh10 ( h – j ). ISH was performed on liver samples using the RNAscope Multiplex Assay. Hybridized probes were imaged with a fluorescence microscope. k , l , Vector DNA was quantified by ISH, and transgene expression was determined by IHC as the percentage of AAV + cells for NHPs administered AAV8 ( k ) or AAVrh10 ( l ). Values are presented as mean ± s.e.m.; * P  < 0.05; ** P  < 0.01; *** P  < 0.001.

Source data

To elucidate the mechanism governing this rapid decline in expression, we evaluated the cellular distribution of rh-β-CG protein expression by IHC (Fig. 1e–j and Supplementary Fig. 1 ) and nuclear DNA by ISH using a probe specific for vector DNA as part of a probe pair to target DNA and RNA separately (Fig. 1k,l ). The number of rh-β-CG + cells declined three- to fivefold from day 14 to day 98 and then remained relatively stable through day 182, consistent with the kinetics of rh-β-CG in serum and transgene RNA expression in the liver. The approximately fourfold reduction in rh-β-CG-expressing cells was not associated with a commensurate reduction in DNA-containing cells, which decreased by only 24–53%.

Vector DNA assembles into discrete nuclear domains that persist despite the loss of transgene expression

We next evaluated the same parameters of gene transfer and expression in macaques intravenously (i.v.) administered AAV8 vectors expressing one of three transgenes: a reporter gene encoding green fluorescent protein (GFP) or a transgene encoding the human or macaque version of the low-density lipoprotein receptor (hLDLR and rhLDLR, respectively; n  = 2 per transgene). These studies allowed us to assess the role of adaptive immunity in the efficiency and stability of transgene expression within a range comprising the highly immunogenic protein GFP to the non-immunogenic self-protein rhLDLR.

Throughout the in-life phase of the study, we used serum LDL levels as an indirect assessment of transgene expression that should reflect the levels of transgene-derived LDLR in real time (Fig. 2a–c ). Animals that received the rhLDLR vector showed an acute and substantial reduction in serum LDL, which returned to levels close to or at baseline within 30 days (Fig. 2a ). We observed a similar pattern of serum LDL for the hLDLR vector but with a lower magnitude of transient reduction (Fig. 2b ). As expected, we did not observe a reduction in serum LDL for the GFP vector (Fig. 2c ). The reduction in serum LDL as a result of transient LDLR expression was associated with an expected acute but transient reduction in serum PCSK9 (Supplementary Fig. 2 ). Serum transaminase levels tracked with the expected immunogenicity of the transgene, ranging from no elevations with rhLDLR (Fig. 2d ) to mild elevations with hLDLR (Fig. 2e ) to a sharp and transient increase with GFP (Fig. 2f ). Sequential measurements of T cells by enzyme-linked immunosorbent spot revealed transgene responses in five of six animals, with the extent of transaminase elevation being commensurate with the degree of transgene immunogenicity (GFP > hLDLR > rhLDLR); T cell activation to the capsid was minimal (Supplementary Fig. 3 ).

figure 2

a – f , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Serum LDL ( a – c ) and ALT ( d – f ) levels were evaluated throughout the in-life phase. Liver tissue was collected during a liver biopsy (14, 77, and 224 days after vector administration) or necropsy (760 days after vector administration). g , h , DNA ( g ) and RNA ( h ) were extracted from liver samples to evaluate the number of vector genome copies and transgene RNA levels, respectively. i – k , ISH was performed on liver samples using the RNAscope Multiplex Assay. The probes used were non-overlapping probe pairs, in which one probe was specific for DNA (binding to the antisense strand), and the second probe hybridized to RNA. Hybridized probes were imaged with a fluorescence microscope. The vector DNA and transgene RNA were quantified as the percentage of AAV + cells for animals treated with AAV vectors expressing rhLDLR ( i ), hLDLR ( j ) or GFP ( k ). Light and dark colors indicate each individual NHP in the cohort; red (rhLDLR), blue (hLDLR) and green (GFP). The dashed lines indicate the level where background can be observed due to autofluorescence.

We performed tissue studies as described for the rh-β-CG experiments, although four samples were available for each animal spanning a longer time frame (that is, biopsies at days 14, 77 and 224 and necropsy at day 760). Analyses of vector DNA and transgene RNA (as measured by qPCR) followed the same trends over time as those for rh-β-CG across all transgenes, showing reductions in both DNA (Fig. 2g ) and RNA (Fig. 2h ), with greater losses in RNA than in DNA. The extent of these reductions was much greater for the transgene encoding GFP (DNA diminished >3,000-fold, and RNA diminished >55,000-fold) than for the transgene encoding rhLDLR (DNA diminished 6-fold, and RNA diminished 29-fold). The hLDLR vector results were more similar to the data for the rhLDLR vector, showing DNA and RNA reductions of 9-fold and 227-fold, respectively.

We performed ISH to characterize the number of cells harboring intranuclear vector DNA compared to those with cytoplasmic transgene-derived RNA (Supplementary Fig. 4 ). The pattern observed for the rhLDLR vector was similar to the rh-β-CG vector results, with high numbers of DNA-containing and RNA-expressing cells at day 14 (65% and 15%, respectively), followed by a 7-fold reduction of DNA over 2 years and a 12-fold reduction in RNA-expressing cells by day 77. The number of RNA-expressing cells then remained stable through day 760, reaching a steady state of ~1% RNA-expressing cells (Fig. 2i and Supplementary Fig. 4 ). The pattern for hLDLR was essentially the same, although with greater reductions in DNA (28-fold) and RNA (~3,000-fold), with RNA-expressing cells falling below the 0.1% threshold of detection at day 760 (Fig. 2j and Supplementary Fig. 4 ). Animals that received the vector encoding GFP exhibited the same high level of gene transfer and transgene expression based on analyses for day 14, although the expression dropped to undetectable levels by day 760 for DNA and by day 77 for RNA (Fig. 2k and Supplementary Fig. 4 ).

DNA-specific ISH revealed two patterns of intranuclear hybridization at day 14: a diffuse granular pattern and a single bright circular structure (Fig. 3a ). Evaluations at later time points demonstrated retention of the circular structures, with a loss of the background granular staining (Fig. 3b ). Confocal imaging illustrated the spherical shape of these structures with a diameter between 0.8 and 1.6 µm (Fig. 3c ). We co-stained sections for vector DNA by ISH and for fibrillarin as a nucleolus marker by IHC. There was no overlap between these two structures, indicating that the single nuclear domain that harbors vector genomes is not related to the nucleolus (Fig. 3d ).

figure 3

a– e , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 vectors encoding rhLDLR, hLDLR, or GFP ( n  = 2 per group). Liver tissue was collected during a liver biopsy (14 days after vector administration) or necropsy (760 days after vector administration). ISH was performed on liver samples using a DNA-specific probe (binding to the antisense strand). a , b , DNA ISH images from NHPs administered rhLDLR at days 14 ( a ) and 760 ( b ) after vector administration. Arrows mark cells with DNA ISH signal that are not hepatocytes; green, vector DNA; blue, DAPI (nuclear counterstain). c , d , Hybridized probes were imaged with a confocal microscope ( c ) and co-stained with a nucleolus marker (fibrillarin antibody) shown in red ( d ). e , Nuclei were extracted from necropsy samples (day 760), and cDNA libraries were created from single nuclei. Nuclei from similar cell types cluster together, and the total percentage of nuclei expressing transgene RNA was evaluated. To enable analysis of transduction at an early time point, we used samples from two additional animals previously treated with 7.5 × 10 12 genome copies per kg (body weight) of AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ). A representative uniform manifold approximation and projection (UMAP) is shown for each group; NK cell, natural killer cell; HSC, hepatic stellate cell.

To better understand the global picture of liver transduction with respect to cell type, we performed single-nucleus RNA sequencing (snRNA-seq; Fig. 3e and Supplementary Fig. 5 ). To enable analysis of transduction at an early time point, we used samples from two additional animals previously administered AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ). snRNA-seq analysis of these liver tissues at day 7 revealed an ~20% transduction of multiple cell types, including hepatocytes, liver sinusoidal endothelial cells (LSECs) and Kupffer cells, indicating that the thyroxine-binding globulin ( TBG ) promoter is not hepatocyte specific. The same analysis of day 760 tissues (Fig. 3e and Supplementary Fig. 5 ) showed reduced transduction similar to that for other measurements of transgene expression in hepatocytes (that is, RNA PCR and RNA ISH), with transduction of 2.5% for rhLDLR, 0.2% for hLDLR and 0.02% for GFP (Fig. 3e ). Only rhLDLR-treated animals had significant detectable transgene expression in non-hepatocytes (that is, LSECs and Kupffer cells) at day 760.

The DNA ISH analyses from rhLDLR tissues were re-evaluated for evidence of vector genomes in non-parenchymal cells in light of the snRNA-seq results that showed expression across multiple cell types. Nuclear staining was indeed demonstrated at day 14 time points in non-hepatocytes, although this was substantially reduced by day 77 (Fig. 3a,b ). The relevance of the wide distribution and expression of the AAV genome throughout different liver cells is unclear to the issue of durability being studied in this manuscript, although it could be important in understanding toxicity of systemic AAVs.

Vector integrates at high frequency throughout chromosomal DNA as complex concatemeric structures

The presence of many non-expressing hepatocytes that continued to harbor vector DNA compelled us to more fully characterize the structure and location of the vector genomes detected by ISH. We and others have shown integration of AAV genome sequences into chromosomal DNA in the setting of DNA repair following double-stranded breaks 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 . We evaluated liver DNA from rh-β-CG- and LDLR/GFP-treated animals for integrated vector sequences using inverted terminal repeat sequencing (ITR-seq), an anchored multiplexed PCR-based next-generation sequencing method developed by our group to detect AAV ITR sequences that have integrated into the genome 18 . This method captures the chromosomal sequences directly adjacent to insertion sites by ligating specific unique molecular identifier (UMI)-containing adapters to sheared DNA. This is followed by PCR amplification using primers specific to the AAV ITR and ligated adapter sequences. AAV integration sites are determined from chimeric sequencing reads that contain both AAV ITR DNA and the adjacent host chromosomal DNA. The numbers and locations of unique genome–AAV junctions were determined for each sample, and the adjacent genomic DNA sequences in each unique AAV integration were further characterized and annotated.

Analysis of tissues at day 182 from rh-β-CG vector-treated animals showed integration events at frequencies of 1.6 per 100 genomes to 1 per 1,000 genomes (Fig. 4a ). A time course of integrations performed in the GFP/LDLR study showed similar levels of integration events, which declined between days 14 and 77 and subsequently stabilized to levels of 0.1–0.7 AAV integration events per 100 genomes (Fig. 4a ). These integrations occurred across the genome and mostly followed a widely dispersed distribution pattern, with the exception of an increase in integrations in and around genes that are highly expressed in the liver (Fig. 4b and Supplementary Fig. 6 ). None of the identified insertion sites from any of the evaluated NHP samples were located within genic regions frequently mutated in human hepatocellular carcinomas (HCCs; including TP53 , TERT , CTNNB1 and so on 26 , 27 , 28 ) nor in genic regions identified in the development of mouse HCC following AAV treatment ( Dlk1 , Tax1bp1 , Meg8 (the mammalian ortholog of the Rian locus) and so on) 29 , 30 , 31 , 32 .

figure 4

a – c , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Liver tissue was collected during a liver biopsy procedure (14, 77 and 224 days after vector administration) or at the time of necropsy (760 days after vector administration). a , DNA was extracted from liver samples, and the number of AAV integration loci in all injected NHPs was determined by ITR-seq. The number of unique integration loci was normalized to 100 genomes based on input DNA. Each NHP had two samples run at each time point, except for at day 760 when several replicates of each NHP were performed. b , The genomic locations of AAV integration loci were determined by ITR-seq and annotated as being within a gene-coding region (genic) or outside of a gene-coding region (intergenic) according to the rhesus macaque RefSeqGene annotation. Integrations within genic regions were further annotated by the distribution of RNA expression in the human liver (data were taken from the Human Genome Atlas at www.proteinatlas.org ). Expression levels were determined by normalized expression (nx) in the human liver for each annotated gene. The following categories were determined: genes not expressed in liver (1 < nx), genes with low expression in liver (1 ≥ nx < 10), genes with medium expression in liver (10 < nx > 100) and genes with high expression in liver (100 ≥ nx). A random distribution represents 10,000 randomly computationally generated genomic loci in the rhesus macaque genome. The number of AAV integration events in each gene category is presented as a fold change over random sequences. A value of 1 would represent no difference from the distribution of random loci (dashed line). Data are presented as mean ± s.e.m. c , The numbers of clones for each unique integration loci detected were determined by requiring the same insertion site and different adapter positions and different UMIs for each clone. The percentage of unique insertion sites that were clonally expanded (two or more clones) is represented in the graphs. Samples were the same as assessed in a . Of clonally expanded loci, the average number of clones and the largest clone detected between the two NHPs for each group is listed below the graph. Data presented as mean ± s.e.m.

To determine whether any of the detected insertion sites exhibited evidence of clonal expansion, we used the UMIs in the ITR-seq reads and the exact nucleotide position of the genomic DNA adjacent to the adapter to remove PCR duplicates and identify and quantify clonal expansion of unique insertion sites, similar to the technique described by Nguyen et al. 33 We defined clonal expansion as two or more unique integrations (as determined by independent UMI sequences and adapter locations) at the same genomic location. Samples were evaluated for the percentage of integrations with clonal expansion, the average size of detected clones and the largest detected clone within each sample (Fig. 4c ). Animals treated with GFP and hLDLR exhibited an increased number of expanded loci and a larger overall size of clones than rhLDLR-treated animals. For all three groups, the largest increase in clonal integration loci was between days 14 and 77. The size of the largest clone in each sample was similar to results of a recent study with AAV-transduced human hepatocytes expanded in a mouse model of xenogenic liver regeneration 34 , both of which are relatively low compared to observations in AAV-treated dogs up to 10 years after vector administration, where vector-induced expansion was proposed 33 .

To fully characterize the composition of AAV sequences at late time points after vector administration, we used multiple long-read single-molecule sequencing techniques. We first performed long-read sequencing of DNA from vector preparations used for animal dosing to assess the integrity of administered AAV genomes. This approach showed complete ITR-to-ITR vector genomes represented the majority of AAV DNA; however, this approach also revealed a minority population of genomes with truncations that were not present in the input plasmid (Supplementary Fig. 7a ). To determine whether a similar proportion of AAV DNA remained intact and was able to drive transgene expression in vivo, we proceeded to also characterize in vivo vector genomes by long-read sequencing. Due to the relatively low abundance of AAV DNA in vivo and its existence as both episomes and broadly distributed integrants, we used a hybridization-based enrichment approach based on binding to biotinylated oligonucleotides tiled across the individual transcriptional units to enrich for vector-containing DNA sequences. The assay was performed with necropsy samples collected at day 760, when adequate material was available for the pulldown enrichments. Sequencing of enriched DNA was performed using high-fidelity (HiFi) circular consensus sequencing (CCS) on a PacBio Sequel II instrument (>99% accuracy and Q  > 20). The CCS reads were then analyzed for the presence of vector and host genome sequences. This approach yielded individual reads ranging from 51 to 50,419 base pairs (bp) in length, with average sequence sizes ranging from 4,216 to 6,113 bp. The number of reads that contained vector sequences was proportional to the total amount of vector DNA originally detected by qPCR, with rhLDLR > hLDLR > GFP (Table 1 ).

Sequence-based analysis of these vector-containing reads demonstrated remarkable heterogeneity in the structure of AAV sequences present in vivo (Fig. 5 ), which often were present in complex concatemers containing mixtures of rearranged and truncated genomes (examples of these complex concatemers are presented in Fig. 5a–d ). Mapping the reads against the input vector sequence illustrated the extensive nature of the rearrangements/truncations that could not have been explained by erroneous input vector and instead must have occurred after administration (compare Supplementary Fig. 7a and 7b–d ).

figure 5

a – d , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Liver tissue was collected at necropsy (760 days after vector administration) for each NHP, and high-molecular-weight DNA was extracted from liver samples and enriched by hybridization to probes that tiled the vector sequence. HiFi long-read sequencing of liver DNA was performed using high consensus accuracy CCS on a PacBio Sequel II instrument (>99% accuracy and Q  > 20). CCS reads were mapped to both the vector and host genomes. For CCS reads containing host genomic sequence, the host genomic sequence is indicated below the scale bars as red boxes and the location of integrated vector DNA was determined as indicated by the red lines marked on each chromosomal picture. Blue boxes indicate vector genome sequences, which were further annotated by component (5' ITR; enhancer, E; promoter, TBG ; intron, IVS2; transgene, rhLDLR; PolyA, BGH; 3' ITR) and by orientation (arrows above scale bar). a , A complete integration would contain two chromosomal junctions flanking the entire integration. b – d , Most integrations were complex concatemers and were incompletely captured, as represented by only one chromosomal junction. Vector integrations in head-to-tail ( b ), head-to-tail and head-to-head ( c ) and head-to-tail and tail-to-tail ( d ) complex concatemeric configurations were seen.

To help determine the likelihood that these rearranged genomes retained the ability to express transgene, we evaluated the individual long-read sequences for the presence of intact transgene cDNA. The number of intact cDNA sequences was very low in the GFP group and increased in the LDLR groups, with rhLDLR > hLDLR; in each group, the number of reads with cDNA sequences was 0-44% of those that showed any vector sequence.

A subset of cDNA containing sequences (that is, ~12%) were shown to contain flanking rhesus macaque genomic sequence in at least one end, suggesting that they were derived from integrated genomes. By simultaneously quantifying the presence of genomic and AAV DNA, we estimated that for rhLDLR samples (where the most integration was seen), between 33% and 39% of integrated sequences contained a fully intact transgene cDNA. However, this likely represents an underestimate because of shearing of the DNA during isolation and premature termination of the sequencing run.

Of all reads containing at least one flanking sequence, 92.9% contained at least one ITR, and 85.2% contained two or more ITRs. Only 10.2% of the ITRs were intact, with the majority showing heterogeneous truncations near a common region of the B–B′ palindromic loop, resulting in an average ITR length of 102.6 bp (Supplementary Fig. 8 ) 35 , 36 . There was remarkable homogeneity in ITR sequences within reads that harbored more than one ITR and substantial variation between ITR sequences of different reads. We broadly assessed variations within the genomic flanking DNA to provide insight into the consequences of integration on genome integrity. Based on all reads containing at least one flanking sequence, the genomic DNA was largely intact (96.8%), with only 0.7% insertions and 2.6% deletions in the flanking genomic DNA. We captured at least four long reads with flanking genomic sequence on both ends of a vector sequence. In these examples, flanking host genomic sequences demonstrated a low percentage of mismatches (94–100% identity); in a few cases, some of the flanking sequences were flipped in orientation and/or repeated, but otherwise, the rhesus macaque genome was largely unperturbed.

Our studies reveal a complex interplay between adaptive immunity and DNA repair that affects the performance of AAV gene therapy in the primate liver. An important finding was the formation of large discrete nuclear domains of vector DNA that persist despite concomitant reductions in transgene expression. The presence of these nuclear domains is reminiscent of the replication centers observed during viral infection with adenovirus and herpes simplex virus. One hypothesis is that transcriptionally active genomes located within these structures, or elsewhere in the nucleus, undergo epigenetic silencing in a similar manner to the inactivation of intranuclear genomes of viruses (such as herpesviruses) by innate host responses. Another potential explanation is that genomes that are transcriptionally active soon after delivery are unstable 37 , such as the transiently appearing vector DNA that is widely dispersed in the nucleus, while the vector genomes within the persisting discrete nuclear domains were never transcriptionally active. Transgene-specific biology (for example, circulating half-life, transgene activity and biodistribution) could also contribute to variability in the pattern of expression observed for several AAV gene therapies over time 9 , 16 . The persistence of these non-expressing nuclear vector domains helps explain the long-standing enigma in primate liver gene therapy studies of high vector DNA in the setting of low vector RNA 38 , 39 .

The demonstration of integrated vector sequences at levels of 1 per 100 cells informs the consideration of safety and efficacy of liver gene therapy in several ways. The abundant and broad distribution of integrations has the potential to lead to malignant transformation. However, none of these integrations were within genes known to be associated with HCC, nor was there evidence of marked clonal expansion during the 2 years of follow-up. The fact that integration events are far less common (about 1%) than the number of cells that express at day 14 (that is, ~20%) and the number of cells that retain vector DNA within the nuclear domain (that is, ~10%) indicates that episomal forms of the vector genome must be responsible for early transcription and the formation of discrete nuclear domains. Similarities in the frequency of integration sites to the number of long-term expressing cells as measured by ISH/IHC and snRNA-seq (~1%) suggests that integration may be responsible for durable expression (summarized in Table 1 ). Long-read sequencing revealed the presence of vector genomes in large complex concatemers harboring many truncations and rearrangements. Evidence to support integration of these concatemers was provided in a subset of reads that contained flanking macaque chromosomal DNA. Limitations in the capture of complete concatemeric structures by long-read sequencing precluded a quantitative assessment of integration frequency, although the presence of integrated sequences with intact vector genomes supports the hypothesis that integrated vectors may be responsible for long-term expression. The finding of high vector DNA in the setting of low vector RNA was shown in our studies with two capsids and three transgenes and was similar to that described by others using different promoters, suggesting that this is a class effect of AAV in primate liver 38 , 39 . However, we cannot rule out attributes of the vector, such as promoter sequence, in influencing expression profiles.

Our studies also demonstrate the impact that adaptive immune responses can have on the frequency and molecular state of the vector DNA (for example, episomal versus integrated DNA). In the case of a non-immunogenic transgene, ~10 genome copies per cell are distributed across nuclear domains present in ~10% of cells, with unique integrations detectable in ~1 out of 100 cells at later time points. Activation of a T cell response to the transgene as observed with GFP substantially reduced the overall vector DNA content to 0.02 genome copies per cell and eliminated most of the nuclear domains to only 0.04% of cells without impacting the number of detected unique integration sites (~1 integration locus per 100 cells). Immune-mediated elimination of episomal viral DNA genomes is a well-known host defense mechanism 40 , 41 , 42 . It is interesting that animals treated with immunogenic transgenes demonstrated more truncations/rearrangements, thereby suggesting that cells expressing functional vector genomes are eliminated over time. It has been shown in clinical trials that steroids may diminish the T cell-mediated reduction in transgene expression 9 , 43 , 44 , although we recently showed in NHPs that steroids do not prevent the acute reduction in expression observed in rhLDLR-treated animals 45 .

Our hypothesis is that episomal vector genomes are inactivated via intracellular host defense mechanisms that the primate liver has evolved to neutralize the onslaught of viruses from the gut virome 40 , 41 , 46 . Insertion of vector genomes into transcriptionally active domains of chromosomal DNA should escape this inactivation. Vector-mediated transgene expression is indeed stable in the livers of lower organisms such as rodents, where host defense pathways are very different 47 , 48 . Although the data are limited, we believe a similar situation exists in some models of human liver gene therapy. Analysis of liver biopsies of human gene therapy recipients demonstrated the presence of rearranged concatemers, variation in transgene RNA/DNA ratios, and low levels of integrated vector genomes, consistent with our studies in NHPs 20 , 49 . Indirect measures of transgene expression, such as serum biomarkers, are complicated. A biphasic response to gene therapy was observed using the short half-life biomarker bilirubin in a human CN1 clinical trial, whereas a more uniform kinetic response has been observed in hemophilia A and hemophilia B clinical trials using the longer half-life readout of serum clotting factors 3 , 4 , 5 , 10 . The durability of AAV transgene expression observed in extrahepatic tissues of all species speaks to the unique behavior of primate liver in modulating AAV transgene expression.

Our findings have implications for improving the efficacy of liver gene therapy. One strategy is to enable the retained episomal AAV genomes located in the discrete nuclear domains to be more transcriptionally active by incorporating cis elements, such as different promoters and insulators, or by using drugs that prevent epigenetic silencing 50 . This approach may be effective regardless of whether vector genomes are active and then silenced or are simply never active. Another strategy, based on the proposal that integrated genomes are more likely to confer durable expression, would be to increase the number of vector integrations into safe harbor sites, as is the goal of some editing strategies for treating loss-of-function diseases. In this scenario, we can view editing-based gene insertions as an extension of gene therapy, in which the editing-based insertions are directed to a specific chromosomal location with higher frequency than the broadly distributed background of insertions observed following gene therapy.

AAV vector production

All AAV vectors were produced by the Penn Vector Core at the University of Pennsylvania, as previously described 29 , and visualized using SnapGene (version 6.2.1). Briefly, plasmids expressing rh-β-CG, codon-optimized rhLDLR, codon-optimized hLDLR and enhanced GFP from the TBG promoter were packaged within the AAV8 capsid. A vector expressing rh-β-CG from the TBG promoter was also packaged with the AAVrh10 capsid. Unique biological materials are available upon request, pending permission by the authors and/or patent holder(s).

Animal studies

The Institutional Animal Care and Use Committee of the University of Pennsylvania approved all animal procedures in this study. We obtained wild-type adult cynomolgus and rhesus macaques aged 3–6 years ( n  = 20) from Covance Research Products. We conducted NHP studies at the University of Pennsylvania within a facility that is registered with the U.S. Department of Agriculture, accredited by the American Association for Accreditation of Laboratory Animal Care, and assured by the Public Health Service. As previously described 51 , we housed animals in stainless steel squeeze-back cages with perches. All cage sizes and housing conditions were compliant with the Guide for the Care and Use of Laboratory Animals. A 12-h light/12-h dark cycle was maintained and controlled via an Edstrom Watchdog system. Animals were fed Certified Primate Diet 5048 (PMI Feeds) two times per day (morning and evening). We also provided an additional variety of food treats that were fit for human consumption, including fruits, vegetables, nuts and cereals, daily as part of the standard enrichment process. Manipulanda, such as kongs, mirrors, a puzzle feeder and raisin balls, were provided daily. Animals also received visual enrichment and daily human interaction. All interventions were performed during the light cycle, and animals were fasted overnight before being anesthetized.

On study day 0, rhesus macaques received 10 13 genome copies per kg (body weight) AAV8.TBG.rh-β-CG ( n  = 6), AAVrh10.TBG.rh-β-CG ( n  = 6), AAV8.TBG.rhLDLR ( n  = 2), AAV8.TBG.hLDLR ( n  = 2) or AAV8.TBG.GFP ( n  = 2) as a 10-ml infusion of vector into the saphenous vein at a rate of 1 ml min –1 via an infusion pump (Harvard Apparatus). Macaques were anesthetized, and blood was collected on selected days via the femoral vein for analysis of complete blood counts, clinical chemistries and coagulation panels by Antech. We determined neutralizing antibody titers using serum samples taken before the initiation of the study, as previously described 52 . All animals had neutralizing antibody titers of <1/5 for the administered AAV capsid before vector administration. At baseline and throughout the in-life phase of the study, we evaluated the animals for serum biomarkers to determine the transgene expression of either rh-β-CG (as measured by enzyme-linked immunosorbent assay, as previously described 53 ) or LDL (as a biomarker for rhLDLR and hLDLR transgene expression). Lipid panel analysis was performed by Antech GLP.

We performed liver biopsies on NHPs throughout the in-life phase of the studies (on study days 14 and 98 for NHPs receiving AAV8.TBG.rh-β-CG or AAVrh10.TBG.rh-β-CG and on study days 14, 77, and 224 for NHPs receiving AAV8.TBG.rhLDLR, AAV8.TBG.hLDLR, or AAV8.TBG.GFP). We conducted a mini-laparotomy procedure to isolate liver tissue and divided the collected samples for histopathology analysis (that is, fixed in 10% neutral buffered formalin) and molecular analysis (that is, frozen on dry ice and stored at −60 °C or colder).

At day 182 after vector administration for NHPs treated with rh-β-CG vectors and at day 760 for NHPs treated with rhLDLR, hLDLR, and GFP vectors, animals were euthanized and necropsied.

Vector genome copy and transgene RNA analysis

Tissue samples were snap-frozen at the time of biopsy or necropsy, DNA was extracted using a QIAamp DNA Mini kit (Qiagen), and DNase-treated total RNA was isolated from 100 mg of tissue. RNA was quantified by spectrophotometry and reverse transcribed to cDNA using random primers. We detected and quantified vector genome copy levels in extracted DNA and transgene expression in extracted RNA by qPCR, as previously described 29 , 51 . Briefly, vector genome copy and RNA levels were quantified using primers and a probe designed for a vector-specific sequence.

We performed IHC for CG on formalin-fixed, paraffin-embedded liver sections. Sections were deparaffinized through a xylene and ethanol series, boiled for 6 min in 10 mM citrate buffer (pH 6.0) for antigen retrieval, and treated with 2% H 2 O 2 (15 min), avidin/biotin-blocking reagents (15 min each; Vector Laboratories) and blocking buffer (1% donkey serum in PBS and 0.2% Triton X-100 for 10 min). We then incubated the sections with rabbit serum to human CG (Abcam, ab9376; diluted 1:200) for 1 h at 37 °C, followed by incubation with biotinylated secondary antibodies (45 min at room temperature; Jackson ImmunoResearch) diluted in blocking buffer according to the manufacturer’s recommendations. We used a Vectastain Elite ABC kit (Vector Laboratories) with 3,3′-diaminobenzidine as a substrate to stain bound antibodies according to the manufacturer’s instructions. No counterstain was applied to the sections to facilitate quantification.

For quantification, we acquired ten random images from each IHC-stained section with a ×10 objective. Using ImageJ software (version 1.52a; http://rsb.info.nih.gov/ij/ ), we measured the area positive for CG IHC and the area occupied by central and portal veins for each image to calculate the average percentage of CG + area of liver tissue (excluding vein areas).

ISH for vector DNA and transgene RNA

We performed ISH on formalin-fixed paraffin-embedded liver sections using an RNAscope Multiplex Fluorescent Reagent kit v2 assay (Advanced Cell Diagnostics) following the manufacturer’s protocol. Probes for two-plex ISH were synthesized by Advanced Cell Diagnostics and designed as non-overlapping probe pairs, where one probe is specific for DNA (binding to the antisense strand), and the second probe hybridizes to RNA. Probes for DNA were stained first and detected by Opal 520 precipitates (imaged with a filter set for fluorescein isothiocyanate), and probes binding RNA/DNA were stained in a second step with Opal 570 deposits (imaged with a rhodamine filter set). Reactive Opal dyes were purchased from Akoya Biosciences, and images were acquired with a Nikon Eclipse Ti-E fluorescence microscope. For some sections, we acquired confocal images using a Leica TCS SP5 confocal microscope with an acousto-optical beam splitter.

To quantify ISH + cells, we scanned stained sections with an Aperio Versa fluorescence slide scanner (Leica Biosystems) and analyzed the sections using Visiopharm software (version 2020.06.0.7872) with applications that detect either the probe signal for DNA inside DAPI-stained nuclei or the probe signal for RNA in the cytoplasm.

ISH with nucleolus localization

After performing ISH, as described above, we further stained some sections with an antibody to fibrillarin as a nucleolar marker. After treatment with 0.5% Triton X-100 in PBS for 2 h and blocking with 1% donkey serum/0.2% Triton X-100 in PBS for 1 h, sections were incubated with rabbit anti-fibrillarin (Abcam, ab166630; diluted 1:100 in 0.5% Triton X-100/PBS) overnight at 4 °C, followed by incubation with Cy5-labeled secondary antibody (donkey anti-rabbit, Jackson ImmunoResearch; diluted 1:100 in 0.5% Triton X-100/PBS for 1 h). We mounted sections using ProLong Gold Antifade Mountant with DAPI (Invitrogen).

Nuclei isolation and snRNA-seq

To isolate nuclei from frozen tissue samples, a modified version of previously published nuclei isolation procedures was used 54 . For these isolations, all buffers and samples were maintained on ice throughout the procedure to maintain nuclei integrity. Buffers were typically made as described below, cooled in advance and supplemented immediately before use to make ‘complete’ buffers at a final concentration of 1 mM DTT, 0.8 U/µl RNase inhibitor (Protector RNase Inhibitor, Roche), and 1× protease inhibitor (complete mini EDTA-free, Roche). To isolate nuclei, ~25 mg of frozen tissue was minced with a scalpel and transferred to a pre-chilled 2-ml Dounce homogenizer with 1 ml of cold complete lysis buffer (0.32 M sucrose, 5 mM CaCl 2 , 3 mM magnesium acetate, 0.1 mM EDTA, 10 mM Tris-HCl (pH 8.0), and 0.1% Triton X-100). The tissue was homogenized with ten strokes each of pestle A and then B, sequentially passed through prewet 100-µm and 30-µm filters and collected in a sterile tube. The homogenizer and filters were washed with an additional three volumes of complete lysis buffer collected with the filtered sample. Two volumes of sample was then layered on top of one volume of cold complete isolation buffer (1.8 M sucrose, 3 mM magnesium acetate, and 10 mM Tris-HCl (pH 8.0)) and centrifuged at 21,000 g for 45 min at 4 °C. The supernatant was then carefully removed, and 100 µl of complete resuspension buffer (250 mM sucrose, 25 mM KCl, 5 mM MgCl 2 , and 20 mM Tris-HCl (pH 7.2)) was added to the tube without mixing. Samples were incubated on ice for 10–15 min, and nuclei were fully resuspended by gently pipetting up and down 20–30 times and counted with an automated cell counter (Countess 3, Thermo Fisher). For submission of snRNA-seq samples, the concentration was adjusted to ~1 × 10 6 nuclei per ml (range of 0.7 × 10 6 –1.2 × 10 6 nuclei per ml), as per the 10x Genomics sample loading guidelines. To identify single-nuclei transcriptomes, the manufacturer’s protocol was followed to achieve ~10,000 partitioned nuclei per sample using the Chromium Controller and 3′ Gene Expression Assay (version 3, 10x Genomics). Nuclei partitioning, reverse transcription and cleanup, cDNA amplification, and library construction and cleanup were all performed as described in the manufacturer’s protocol, and libraries were sequenced on an Illumina NextSeq2000 to an average depth of ~34,000 reads per nuclei. In addition to liver samples from NHPs described in these studies and to enable analysis of transduction at an early time point, we used samples from two additional animals previously administered AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ).

snRNA-seq analysis

After sequencing, demultiplexed fastq files were passed through the Cell Ranger count pipeline (version 5.0.1; 10x Genomics) and aligned against a custom reference genome consisting of the rhesus macaque reference (Mmul_10) and the complete annotated plasmid sequence used in the generation of the rAAV vector. Cell Ranger-generated count matrices were then further analyzed within R, with R packages maintained by Bioconductor (version 3.16), using the Seurat package (version 4.3), as previously described 55 . Each individual sample dataset was normalized using the sctransform method, and principal component analysis, UMAP and nuclei clustering were all performed using standard functions within Seurat. For cohort representations, the individual normalized datasets were integrated together by cohort based on the expression of a set of anchor genes using Seurat functions. Cell-type annotation was determined by examining the level of expression of a set of cell-type-specific genes across each cluster of the integrated datasets using the following gene signatures: TTN , TF , FGG , FGA , FGB , SERPINA1 , CPS1 , CYP3A7 and CYP2E1 (hepatocytes); FCGR2A , STAB2 , BMPER , NAV1 , TIE1 , FCN3 , LYVE1 , CLEC4G and F8 (LSECs); CMKLR1 , HTR7 , AOAH , CPVL , MSR1 , CD163 , MRC1 , CD200R1 , ITGAX , ADGRE1 and FCGR1A (macrophages); CMKLR1 , HTR7 , AOAH , CPVL , MSR1 , CD163 , MRC1 , CD200R1 , TIMD4 , ADGRE1 , CLEC4F and FCGR1A (Kupffer cells); RBMS3 , PTH1R , CCBE1 , C7 , ITGA9 and GRK5 (hepatic stellate cells); LCK , CD247 , STAT4 , BCL11B , RASGRP1 , CD3G , CD3D and CD3E (T and natural killer cells); LAMC1 , LAMC2 , BEND5 , VEPH1 , SLC28A3 , GRHL2 and PKHD1 (cholangiocytes) and FCRL1 , FCMR , BANK1 , IRF4 , BLK , MS4A1 , PAX5 and CD19 (B cells). Data visualizations were completed within Seurat and ggplot2 (version 3.4.0)

Next-generation sequencing for AAV integration analysis

We identified AAV integration sites in the host genome by ITR-seq, as previously described 18 . Briefly, purified liver DNA was sheared using an ME220 focused ultrasonicator, end repaired, A tailed and ligated to unique Illumina Y adapters that contain a sample barcode and a randomly assigned UMI sequence (UMI in the form of NNWNNWNN). Using AAV ITR and adapter-specific primers, we amplified ITR-containing DNA fragments and generated next-generation sequencing-compatible libraries. We sequenced the DNA on a MiSeq instrument (Illumina) and mapped the obtained reads to the rhesus macaque reference genome and the administered AAV vector genome. We used a custom script to identify AAV integration sites from the mapped reads, which was updated since previously described 18 to streamline steps, replace outdated programs and allow for the detection of integration site clones.

Mapped reads are labeled with the genomic location of the ITR–genome junction, the adapter–genome junction and the UMI sequence on the adapter. The number of unique genome–AAV junctions was determined for each sample, and this number was normalized to 100 genomes based on input DNA. The number of expansions (clones) for each unique genome–AAV junction was determined by the number of reads at the same unique AAV–genome junction that contain unique adapter–genome junctions and unique UMIs. By requiring both a unique adapter position and a unique UMI for a given ITR integration position, we were able to differentiate between reads originating from cell clones (that is, the same ITR position but different adapter position and different UMI) and PCR duplicates (that is, the same ITR position and same adapter position and/or same UMI) with an enhanced degree of accuracy over previous studies.

The sites were annotated as being within a gene-coding region (genic) or outside of a gene-coding region (intergenic) according to the rhesus macaque Mmul_10 RefSeqGene annotation. Integrations within genic regions were further annotated by the distribution of RNA expression in the human liver (data taken from the Human Genome Atlas; www.proteinatlas.org ) and for the presence within genes identified as commonly mutated in HCC ( TERT , TP53 , CTNNB1 , AXIN1 , ARID1A , BAP1 , KEAP1 , RB1 and NFE2L2 ) and within genes indicated in rAAV-associated mouse HCC ( DLK1 , Tax1bp1 , Hras , Sos1 , Fgf3 and MEG8 (the mammalian ortholog of the Rian locus)). Expression levels were determined by nx in the human liver for each annotated gene. The following categories were determined: genes not expressed in liver (1 < nx), genes with low expression in liver (1 ≥ nx < 10), genes with medium expression in liver (10 < nx > 100) and genes with high expression in liver (100 ≥ nx). A random distribution represents 10,000 randomly computationally generated genomic loci in the rhesus macaque genome. The number of AAV integration events in each gene category is presented as fold change over random sequences. A value of 1 would represent no difference from the distribution of random loci.

Enriched long-read sequencing of liver DNA

Total high-molecular-weight DNA was extracted from liver tissue collected at necropsy from NHPs treated with AAV8.TBG.rhLDLR, AAV8.TBG.hLDLR or AAV8.TBG.GFP (day 760). Biotinylated probes complementary to the ITRs, enhancer, promoter, transgene, woodchuck hepatitis virus post-transcriptional regulatory element (when present) and poly(A) sequences of the vector were hybridized with DNA samples, followed by pulldown with streptavidin-conjugated beads. Enriched DNA was subjected to unbiased linear amplification using the repliG system (Qiagen) and submitted for long-read sequencing using the PacBio Sequel II system and HiFi read technology. To generate these HiFi reads, the pool of enriched DNA was assembled into SMRTbell templates, which contain the double-stranded template DNA to be sequenced with single-stranded hairpin adapters on either end, and subjected to sequencing via CCS with 30 h of sequencing time.

The generated HiFi CCS reads (>99% accuracy and Q  > 20) were mapped to the rhesus macaque and vector genomes with quantitative and qualitative assessments made using a custom analysis pipeline including BEDtools (version 2.30.0), Samtools (version 1.11), Minimap2 (version 2.24), Cutadapt (version 3.4) and Picard (version 2.26.10), along with visualization of individual reads using the Integrative Genomics Viewer (version 2.16.0). The numbers of CCS reads containing a functional transgene with or without a promoter upstream of the transgene sequence were determined. Reads containing flanking genomic DNA and vector DNA were categorized as integrated. The CIGAR string of these AAV/genomic DNA chimeric reads was used to extract the insertions and deletions within the rhesus genome. Reads containing flanking genomic sequence on both ends of vector sequence were broadly assessed for integrity of the adjacent genomic DNA via NCBI BLAST RefSeq Genome Database for Rhesus Macaques. Reads with at least one flanking genomic sequence were assessed for the presence of ITR sequence and whether the ITR was intact or had a break point. An intact ITR sequence was defined as having a length of 165–173 bp. Break points were assessed, and ITRs from the same long read were compared.

Long-read analysis of vector and plasmid DNA by Oxford nanopore sequencing

Plasmid DNA used for vector production was linearized by restriction enzyme digestion and sequenced by Oxford Nanopore Technologies long-read sequencing. For AAV vectors, lambda genome was spiked in, and DNase was added to remove potentially contaminating DNA. The capsid was then denatured, and the vector genomes were annealed to create a double-stranded template. Library preparations for plasmid DNA and vector were performed using the Ligation Sequencing gDNA Native Barcoding kit (SQK-NBD112.24) from Oxford Nanopore Technologies. A custom script tested for remaining lambda DNA (to ensure that the DNase treatment worked) and allowed for subsequent mapping of long-read sequences to the plasmid DNA sequence, vector ITR-to-ITR genome and/or trans - and helper plasmids used in vector production, Escherichia coli and HEK293 cell DNA.

Statistical analysis

Comparisons between time points were performed for vector genome copy, transgene RNA, DNA ISH and RNA ISH levels using paired t -tests in the ‘t.test’ function within the R Program (version 4.1.3). We conducted comparisons between vector genome copies and transgene RNA and quantifications of DNA ISH and IHC using linear mixed-effect modeling and the ‘lme’ function in the ‘nlme’ package for R. A P value of <0.05 was considered significant.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Data availability

All data discussed in the manuscript are available in the main text or Supplementary Materials . ITR-seq data are available on GitHub ( https://github.com/Penn-GTP/ITR-seq2_public , version 2.1.1). Complete clinical pathology data can be obtained upon request.

European Medicines Agency. Hemgenix (etranacogene dezaparvovec). European Medicines Agency https://www.ema.europa.eu/en/medicines/human/EPAR/hemgenix (2023).

European Medicines Agency. Cevenfacta (eptacog beta (activated)). European Medicines Agency https://www.ema.europa.eu/en/medicines/human/EPAR/cevenfacta (2023).

George, L. A. et al. Multiyear factor VIII expression after AAV gene transfer for hemophilia A. N. Engl. J. Med. 385 , 1961–1973 (2021).

Article   CAS   PubMed   PubMed Central   Google Scholar  

Konkle, B. A. et al. BAX 335 hemophilia B gene therapy clinical trial results: potential impact of CpG sequences on gene expression. Blood 137 , 763–774 (2021).

Leavitt, A. D. et al. Updated follow-up of the Alta Study, a phase 1/2 study of giroctocogene fitelparvovec (SB-525) gene therapy in adults with severe hemophilia A. Blood 136 , 12 (2020).

Article   Google Scholar  

Manno, C. S. et al. Successful transduction of liver in hemophilia by AAV-factor IX and limitations imposed by the host immune response. Nat. Med. 12 , 342–347 (2006).

Article   CAS   PubMed   Google Scholar  

Mingozzi, F. et al. Modulation of tolerance to the transgene product in a nonhuman primate model of AAV-mediated gene transfer to liver. Blood 110 , 2334–2341 (2007).

Pasi, K. J. et al. Multiyear follow-up of AAV5-hFVIII-SQ gene therapy for hemophilia A. N. Engl. J. Med. 382 , 29–40 (2020).

George, L. A. et al. Hemophilia B gene therapy with a high-specific-activity factor IX variant. N. Engl. J. Med. 377 , 2215–2227 (2017).

Dhawan, A. et al. Longitudinal study (LUSTRO) of the spectrum of clinical disease in young Crigler–Najjar patients and plans for a phase 1/2 study (VALENS) evaluating UGT1A1 gene therapy safety and preliminary efficacy with an AAV8 vector construct, AT342, in Crigler–Najjar patients. In Abstracts of the 51st Annual Congress of the European Society for Paediatric Gastroenterology, Hepatology and Nutrition (ESPGHAN), Geneva, Switzerland , 9–12 May 2018, Poster H-P-027, Abstract 553 (2018).

Duncan, A. W., Dorrell, C. & Grompe, M. Stem cells and liver regeneration. Gastroenterology 137 , 466–481 (2009).

Article   PubMed   Google Scholar  

Greig, J. A. et al. AAV8 gene therapy for Crigler–Najjar syndrome in macaques elicited transgene T cell responses that are resident to the liver. Mol. Ther. Methods Clin. Dev. 11 , 191–201 (2018).

Greig, J. A. et al. Non-clinical study examining AAV8.TBG.hLDLR vector-associated toxicity in chow-fed wild-type and LDLR +/– rhesus macaques. Hum. Gene Ther. Clin. Dev. 28 , 39–50 (2017).

Greig, J. A. et al. Optimized adeno-associated viral-mediated human factor VIII gene therapy in cynomolgus macaques. Hum. Gene Ther. 29 , 1364–1375 (2018).

McIntosh, J. et al. Therapeutic levels of FVIII following a single peripheral vein administration of rAAV vector encoding a novel human factor VIII variant. Blood 121 , 3335–3344 (2013).

Ozelo, M. C. et al. Valoctocogene roxaparvovec gene therapy for hemophilia A. N. Engl. J. Med. 386 , 1013–1025 (2022).

Greig, J. A. et al. Impact of intravenous infusion time on AAV8 vector pharmacokinetics, safety, and liver transduction in cynomolgus macaques. Mol. Ther. Methods Clin. Dev. 3 , 16079 (2016).

Article   PubMed   PubMed Central   Google Scholar  

Breton, C., Clark, P. M., Wang, L., Greig, J. A. & Wilson, J. M. ITR-seq, a next-generation sequencing assay, identifies genome-wide DNA editing sites in vivo following adeno-associated viral vector-mediated genome editing. BMC Genomics 21 , 239 (2020).

Chandler, R. J. et al. Vector design influences hepatic genotoxicity after adeno-associated virus gene therapy. J. Clin. Invest. 125 , 870–880 (2015).

Gil-Farina, I. et al. Recombinant AAV integration is not associated with hepatic genotoxicity in nonhuman primates and patients. Mol. Ther. 24 , 1100–1105 (2016).

Huser, D., Gogol-Doring, A., Chen, W. & Heilbronn, R. Adeno-associated virus type 2 wild-type and vector-mediated genomic integration profiles of human diploid fibroblasts analyzed by third-generation PacBio DNA sequencing. J. Virol. 88 , 11253–11263 (2014).

Paneda, A. et al. Safety and liver transduction efficacy of rAAV5-cohPBGD in nonhuman primates: a potential therapy for acute intermittent porphyria. Hum. Gene Ther. 24 , 1007–1017 (2013).

Paulk, N. K. et al. Adeno-associated virus gene repair corrects a mouse model of hereditary tyrosinemia in vivo. Hepatology 51 , 1200–1208 (2010).

Kaeppel, C. et al. A largely random AAV integration profile after LPLD gene therapy. Nat. Med. 19 , 889–891 (2013).

Colella, P., Ronzitti, G. & Mingozzi, F. Emerging issues in AAV-mediated in vivo gene therapy. Mol. Ther. Methods Clin. Dev. 8 , 87–104 (2017).

Cancer Genome Atlas Research Network. Comprehensive and integrative genomic characterization of hepatocellular carcinoma. Cell 169 , 1327-1341 (2017).

Nault, J. C. et al. Clinical impact of genomic diversity from early to advanced hepatocellular carcinoma. Hepatology 71 , 164–182 (2020).

Ng, C. K. Y. et al. Integrative proteogenomic characterization of hepatocellular carcinoma across etiologies and stages. Nat. Commun. 13 , 2436 (2022).

Bell, P. et al. Analysis of tumors arising in male B6C3F1 mice with and without AAV vector delivery to liver. Mol. Ther. 14 , 34–44 (2006).

Donsante, A. et al. Observed incidence of tumorigenesis in long-term rodent studies of rAAV vectors. Gene Ther. 8 , 1343–1346 (2001).

Rosas, L. E. et al. Patterns of scAAV vector insertion associated with oncogenic events in a mouse model for genotoxicity. Mol. Ther. 20 , 2098–2110 (2012).

Zhong, L. et al. Recombinant adeno-associated virus integration sites in murine liver after ornithine transcarbamylase gene correction. Hum. Gene Ther. 24 , 520–525 (2013).

Nguyen, G. N. et al. A long-term study of AAV gene therapy in dogs with hemophilia A identifies clonal expansions of transduced liver cells. Nat. Biotechnol. 39 , 47–55 (2021).

Dalwadi, D. A. et al. AAV integration in human hepatocytes. Mol. Ther. 29 , 2898–2909 (2021).

Duan, D., Yan, Z., Yue, Y. & Engelhardt, J. F. Structural analysis of adeno-associated virus transduction circular intermediates. Virology 261 , 8–14 (1999).

Yang, J. et al. Concatamerization of adeno-associated virus circular genomes occurs through intermolecular recombination. J. Virol. 73 , 9468–9477 (1999).

Wang, J. et al. Existence of transient functional double-stranded DNA intermediates during recombinant AAV transduction. Proc. Natl Acad. Sci. USA 104 , 13104–13109 (2007).

Hurlbut, G. D. et al. Preexisting immunity and low expression in primates highlight translational challenges for liver-directed AAV8-mediated gene therapy. Mol. Ther. 18 , 1983–1994 (2010).

Nathwani, A. C. et al. Long-term safety and efficacy following systemic administration of a self-complementary AAV vector encoding human FIX pseudotyped with serotype 5 and 8 capsid proteins. Mol. Ther. 19 , 876–885 (2011).

Chan, Y. K. & Gack, M. U. Viral evasion of intracellular DNA and RNA sensing. Nat. Rev. Microbiol. 14 , 360–373 (2016).

Miettinen, M., Sareneva, T., Julkunen, I. & Matikainen, S. IFNs activate Toll-like receptor gene expression in viral infections. Genes Immun. 2 , 349–355 (2001).

Chisari, F. V., Isogawa, M. & Wieland, S. F. Pathogenesis of hepatitis B virus infection. Pathol. Biol. 58 , 258–266 (2010).

Jiang, H. et al. Effects of transient immunosuppression on adenoassociated, virus-mediated, liver-directed gene transfer in rhesus macaques and implications for human gene therapy. Blood 108 , 3321–3328 (2006).

Nathwani, A. C. et al. Long-term safety and efficacy of factor IX gene therapy in hemophilia B. N. Engl. J. Med. 371 , 1994–2004 (2014).

Wang, L. et al. Prednisolone reduces the interferon response to AAV in cynomolgus macaques and may increase liver gene expression. Mol. Ther. Methods Clin. Dev. 24 , 292–305 (2022).

Cao, Z. et al. The gut virome: a new microbiome component in health and disease. EBioMedicine 81 , 104113 (2022).

Cunningham, S. C., Dane, A. P., Spinoulas, A., Logan, G. J. & Alexander, I. E. Gene delivery to the juvenile mouse liver using AAV2/8 vectors. Mol. Ther. 16 , 1081–1088 (2008).

Dane, A. P., Wowro, S. J., Cunningham, S. C. & Alexander, I. E. Comparison of gene transfer to the murine liver following intraperitoneal and intraportal delivery of hepatotropic AAV pseudo-serotypes. Gene Ther. 20 , 460–464 (2013).

Fong, S. et al. Interindividual variability in transgene mRNA and protein production following adeno-associated virus gene therapy for hemophilia A. Nat. Med. 28 , 789–797 (2022).

Moore, T. V. et al. HDAC inhibition prevents transgene expression downregulation and loss-of-function in T-cell-receptor-transduced T cells. Mol. Ther. Oncolytics 20 , 352–363 (2021).

Greig, J. A. et al. Intramuscular injection of AAV8 in mice and macaques is associated with substantial hepatic targeting and transgene expression. PLoS ONE 9 , e112268 (2014).

Calcedo, R., Vandenberghe, L. H., Gao, G., Lin, J. & Wilson, J. M. Worldwide epidemiology of neutralizing antibodies to adeno-associated viruses. J. Infect. Dis. 199 , 381–390 (2009).

Ziegler, T. E., Matteri, R. L. & Wegner, F. H. Detection of urinary gonadotropins in callitrichid monkeys with a sensitive immunoassay based upan a unique monoclonal antibody. Am. J. Primatol. 31 , 181–188 (1993).

Zhu, Y. et al. Spatiotemporal transcriptomic divergence across human and macaque brain development. Science 362 , eaat8077 (2018).

Hao, Y. et al. Integrated analysis of multimodal single-cell data. Cell 184 , 3573–3587 (2021).

Download references

Acknowledgements

We thank A. N. Avitto, J. K. Chorazeczewski, R. Fadnavis, T. Furmanak, M. Jennis and M. K. Smith for their support of this project and instrumental contributions. We also thank T. Jiang for scanning the slides used for quantification. We thank N. Denton for assistance with manuscript preparation and graphics and H. Yan and K. Olagbegi for help with statistical analysis. We thank the Biostatistics and Bioinformatics Core, Immunology Core, Nucleic Acid Technologies Core, Histopathology Core, Program for Comparative Medicine and Vector Core of the Gene Therapy Program at the University of Pennsylvania for study support. All vectors were produced by the Penn Vector Core (RRID SCR_022432). This work was supported by Amicus Therapeutics, Passage Bio and Ultragenyx.

Author information

These authors contributed equally: Jenny A. Greig, Kelly M. Martins.

Authors and Affiliations

Gene Therapy Program, Department of Medicine, Perelman School of Medicine, University of Pennsylvania, Philadelphia, PA, USA

Jenny A. Greig, Kelly M. Martins, Camilo Breton, R. Jason Lamontagne, Yanqing Zhu, Zhenning He, John White, Jing-Xu Zhu, Jessica A. Chichester, Qi Zheng, Zhe Zhang, Peter Bell, Lili Wang & James M. Wilson

You can also search for this author in PubMed   Google Scholar

Contributions

Conceptualization: J.A.G., C.B., L.W. and J.M.W. Data curation: J.A.G., C.B., Z.H., J.W., P.B. and L.W. Formal analysis: J.A.G., K.M.M., C.B., R.J.L., Z.H., J.W., J.A.C., Q.Z., Z.Z., P.B. and L.W. Investigation: J.A.G., K.M.M., C.B., R.J.L., Y.Z., J.-X.Z., J.A.C., Q.Z., Z.Z., P.B. and J.M.W. Methodology: J.A.G., K.M.M., C.B., R.J.L., Y.Z., J.-X.Z., J.A.C., Q.Z., Z.Z., P.B., L.W. and J.M.W. Supervision: J.A.G., C.B., P.B., L.W. and J.M.W. Visualization: J.A.G., K.M.M., C.B. and R.J.L. Writing, original draft: J.A.G., C.B. and J.M.W. Writing, review and editing: J.A.G., K.M.M., C.B., R.J.L., L.W. and J.M.W. Software development: Q.Z. and P.B. Funding acquisition: J.M.W.

Corresponding author

Correspondence to James M. Wilson .

Ethics declarations

Competing interests.

J.M.W. is a paid advisor to and holds equity in iECURE, Scout Bio, Passage Bio and the Center for Breakthrough Medicines (CBM). J.M.W. also holds equity in the former G2 Bio asset companies and has sponsored research agreements with Amicus Therapeutics, CBM, Elaaj Bio, FA212, former G2 Bio asset companies, iECURE, Passage Bio and Scout Bio, which are licensees of Penn technology. J.A.G., C.B., L.W. and J.M.W. are inventors on patents that have been licensed to various biopharmaceutical companies and for which they may receive payments. All other authors have no competing interests.

Peer review

Peer review information.

Nature Biotechnology thanks Luigi Naldini, Terence Flotte and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary information.

Supplementary Figs. 1–8.

Reporting Summary

Source data figs. 1–4.

Source data for Figs. 1a–d,k,l , 2a–k , 3e and 4a–c .

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ .

Reprints and permissions

About this article

Cite this article.

Greig, J.A., Martins, K.M., Breton, C. et al. Integrated vector genomes may contribute to long-term expression in primate liver after AAV administration. Nat Biotechnol (2023). https://doi.org/10.1038/s41587-023-01974-7

Download citation

Received : 09 March 2022

Accepted : 29 August 2023

Published : 06 November 2023

DOI : https://doi.org/10.1038/s41587-023-01974-7

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

This article is cited by

  • Mercedes Barzi
  • Karl-Dimiter Bissig

Nature Communications (2024)

Adeno-associated virus as a delivery vector for gene therapy of human diseases

  • Jiang-Hui Wang
  • Dominic J. Gessler
  • Guangping Gao

Signal Transduction and Targeted Therapy (2024)

Engineering APOBEC3A deaminase for highly accurate and efficient base editing

Nature Chemical Biology (2024)

Tracing the fate of AAV vectors in the body

  • Nerea Zabaleta
  • Irene Gil-Farina

Nature Biotechnology (2023)

Quick links

  • Explore articles by subject
  • Guide to authors
  • Editorial policies

Sign up for the Nature Briefing: Translational Research newsletter — top stories in biotechnology, drug discovery and pharma.

c assignment expression

IMAGES

  1. Evaluate an Expression in C Example 5 Assignment

    c assignment expression

  2. Evaluate an Expression in C Example 4 Assignment

    c assignment expression

  3. Assignment Operators in C

    c assignment expression

  4. 025 Compound assignment operators (Welcome to the course C programming)

    c assignment expression

  5. Programming Univbasics Expression And...

    c assignment expression

  6. Programming Univbasics The Assignment...

    c assignment expression

VIDEO

  1. Assignment Operator in C Programming

  2. NPTEL Problem Solving through Programming in C ASSIGNMENT 6 ANSWERS 2024

  3. Decision Making & Conditional Statement in C Language Part

  4. Augmented assignment operators in C

  5. Assignment Operator in C Programming

  6. Syntax directed definition of simple desk calculator||Annotated parse tree for 3*5+4n

COMMENTS

  1. Assignment Expressions (GNU C Language Manual)

    7 Assignment Expressions. As a general concept in programming, an assignment is a construct that stores a new value into a place where values can be stored—for instance, in a variable. Such places are called lvalues (see Lvalues) because they are locations that hold a value. An assignment in C is an expression because it has a value; we call it an assignment expression.

  2. c

    An assignment expression has the value of the left operand after the assignment. It's to allow things like this: a = b = c; (although there's some debate as to whether code like that is a good thing or not.) Incidentally, this behaviour is replicated in Java (and I would bet that it's the same in C# too).

  3. c

    0. Roughly speaking, in C; A statement is a section of code that produces an observable effect; An expression is a code construct which accesses at least one data item, performs some operation of the result of that access (or those accesses), and produces at least one result. An expression may be composed of (smaller) expressions.

  4. Assignment operators

    Assignment performs implicit conversion from the value of rhs to the type of lhs and then replaces the value in the object designated by lhs with the converted value of rhs . Assignment also returns the same value as what was stored in lhs (so that expressions such as a = b = c are possible). The value category of the assignment operator is non ...

  5. What is the result of an assignment expression in C?

    1. This is an infinite loop. It first assign 10 to c, then compare it with c > 0, then again loop starts, assign 10 to c, compare it with c>0 and so on. Loop never ends. This is equivalent to the following: while(c=10); /* Because c assign a garbage value, but not true for all cases maybe it assign 0 */. while(c);

  6. Assignment Operators in C

    1. "=": This is the simplest assignment operator. This operator is used to assign the value on the right to the variable on the left. Example: a = 10; b = 20; ch = 'y'; 2. "+=": This operator is combination of '+' and '=' operators. This operator first adds the current value of the variable on left to the value on the right and ...

  7. Assignment Operators in C

    Assignment Operators in C - In C language, the assignment operator stores a certain value in an already declared variable. A variable in C can be assigned the value in the form of a literal, another variable, or an expression. ... In C, the expressions that refer to a memory location are called "lvalue" expressions. A lvalue may appear as ...

  8. C Assignment Operators

    The assignment operators in C can both transform and assign values in a single operation. C provides the following assignment operators: | =. In assignment, the type of the right-hand value is converted to the type of the left-hand value, and the value is stored in the left operand after the assignment has taken place.

  9. Assignment operators

    for assignments to class type objects, the right operand could be an initializer list only when the assignment is defined by a user-defined assignment operator. removed user-defined assignment constraint. CWG 1538. C++11. E1 ={E2} was equivalent to E1 = T(E2) ( T is the type of E1 ), this introduced a C-style cast. it is equivalent to E1 = T{E2}

  10. C Assignment Operators

    Code language:C++(cpp) The = assignment operator is called a simple assignment operator. It assigns the value of the left operand to the right operand. Besides the simple assignment operator, C supports compound assignment operators. A compound assignment operator performs the operation specified by the additional operator and then assigns the ...

  11. Assignment Operator in C

    Let's discuss it here in detail. The assignment operator ( = ) is used to assign a value to the variable. Its general format is as follows: variable = right_side. The operand on the left side of the assignment operator must be a variable and operand on the right-hand side must be a constant, variable or expression.

  12. Assignment and shorthand assignment operator in C

    Shorthand assignment operator combines one of the arithmetic or bitwise operators with assignment operator. For example, consider following C statements. int a = 5; a = a + 2; The above expression a = a + 2 is equivalent to a += 2. Similarly, there are many shorthand assignment operators. Below is a list of shorthand assignment operators in C.

  13. Operators in C

    Operators are symbols used for performing some kind of operation in C. There are six types of operators, Arithmetic Operators, Relational Operators, Logical Operators, Bitwise Operators, Assignment Operators, and Miscellaneous Operators. Operators can also be of type unary, binary, and ternary according to the number of operators they are using.

  14. C Programming Operators and Expressions

    Assignment operators are used to assign result of an expression to a variable. '=' is the assignment operator in C. Furthermore, C also allows the use of shorthand assignment operators. Shorthand operators take the form:

  15. Operators in C and C++

    All assignment expressions exist in C and C++ and can be overloaded in C++. For the given operators the semantic of the built-in combined assignment expression a ⊚= b is equivalent to a = a ⊚ b, except that a is evaluated only once. Operator name Syntax C++ prototype examples As member of K

  16. C Compound Assignment

    The compound-assignment operators combine the simple-assignment operator with another binary operator. Compound-assignment operators perform the operation specified by the additional operator, then assign the result to the left operand. For example, a compound-assignment expression such as. expression1 += expression2. can be understood as.

  17. Assignment operators

    In this article. The assignment operator = assigns the value of its right-hand operand to a variable, a property, or an indexer element given by its left-hand operand. The result of an assignment expression is the value assigned to the left-hand operand. The type of the right-hand operand must be the same as the type of the left-hand operand or implicitly convertible to it.

  18. C Operator Precedence

    For example, the expression * p ++ is parsed as * (p ++), and not as (* p) ++. Operators that are in the same cell (there may be several rows of operators listed in a cell) are evaluated with the same precedence, in the given direction. For example, the expression a = b = c is parsed as a = (b = c), and not as (a = b) = c because of right-to ...

  19. Assignment Statement in C Programming Language

    C provides an assignment operator for this purpose, assigning the value to a variable using assignment operator is known as an assignment statement in C. The function of this operator is to assign the values or values in variables on right hand side of an expression to variables on the left hand side. The syntax of the assignment expression

  20. Help with Time Remap expression

    Help me with expression... I have comp "ONE", there in layer "TWO" comp with animation (10 sec). I need that when animated, from right to left, comp "TWO" crosses comp "ONE" in the middle, in comp "TWO" starts animation from the first frame (before the intersection, the animation should be frozen on the 1st frame).

  21. c

    You cant assign arrays in C. You only assign scalar types (integers, pointers, structs and unions) but not the arrays. Structs can be used as a workaround if you want to copy the array. char c[20]; struct bar b = {.c = "Hello World!!"}; struct bar x;

  22. Welcome to ITC Ratnadipa, a Luxury Collection Hotel, Colombo

    21 Galle Face Centre Rd, Colombo, Sri Lanka, 00100. ROOM RESERVATIONS PHONE NUMBER: +94 11-4999111. Fax: +94 11-4999100. Follow ITC Ratnadipa, a Luxury Collection Hotel, Colombo. Book your escape at ITC Ratnadipa, a Luxury Collection Hotel, Colombo. Our exclusive hotel in Colombo offers luxury accommodations & elevated experiences.

  23. Yankees' Cole has third bullpen session. Domínguez is ready to start a

    Domínguez is ready to start a minor league rehab assignment. 1 of 4 | New York Yankees pitcher Gerrit Cole throws a bullpen session before a baseball game against the Tampa Bay Rays, Saturday, May 11, 2024, in St. Petersburg, Fla. (AP Photo/Chris O'Meara) Read More. 1 of 4.

  24. Judge dismisses lawsuit by mother who said school hid teen's gender

    PORTLAND, Maine (AP) — A federal judge dismissed a lawsuit brought by a Maine woman who accused school officials of encouraging her teen's gender expression by providing a chest binder and using a new name and pronouns, without consulting parents. U.S. District Judge Jon Levy acknowledged his decision that a mother such as Amber Lavigne ...

  25. Refactor your code with C# collection expressions

    The spread element is often confused with the term "spread operator". In C#, there's no such thing as a "spread operator". The .. expression isn't an operator, it's an expression that's part of the spread element syntax. By definition, this syntax doesn't align with that of an operator, as it doesn't perform an operation on its operands.

  26. Integrated vector genomes may contribute to long-term expression in

    To elucidate the mechanism governing this rapid decline in expression, we evaluated the cellular distribution of rh-β-CG protein expression by IHC (Fig. 1e-j and Supplementary Fig. 1) and ...

  27. c

    Then, correcting the data type, considering the char array is used, In the first case, arr = "Hello"; is an assignment, which is not allowed with an array type as LHS of assignment. OTOH, char arr[10] = "Hello"; is an initialization statement, which is perfectly valid statement. edited Oct 28, 2022 at 14:48. knittl.

  28. C# Lambda => expressions failing in visual studio 2010 from reverse

    The goal of all of this is to replace a dll with editable source code. I need to see how I can rewrite these statements without using the lambda. Not included here, some of it I can rewrite, but I'm copy pasting what I don't understand how to rewrite. 1: public override string object_type => "access_token"; 2: public override string resource ...