answersLogoWhite

0

example in C:

const int a [] = {10, 20, 40, 80};

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Can you declare constructor as constant if yes why?

Constructors are implicitly constant members of a class. They do not modify objects, rather they initialize them. So constant and not constant objects can invoke them: const MyClass object; // invokes MyClass::MyClass() constructor


Declare a numerical variable precise and initialize it to the value 1.09388641?

double precise = 1.09388641;


What is memory leakage in terms of arrays?

leakage in arrays occur when you declare an array with big size and using only very few bytes.


Declare and initialize 2D array in java using two statements- one to declare variable the other to initialize elements?

I'm not sure what you're asking. Do you mean when you declare/instantiate an array like this? int[][] arr; arr = {{1, 2, 3},{4, 5, 6}}; I think that's right. *********************************** THIS IS INCORRECT because you can assign constant values to array only at time of initialization. Therefore above code will throw an error. Correct way is: int[][] arr = {{1, 2, 3},{4, 5, 6}}; thanx .. itsabhinav123@gmail.com


What are the steps to create a permanent set in a programming language?

To create a permanent set in a programming language, you typically need to declare the set, initialize it with values, and ensure that the set is stored in a way that persists beyond the current program execution. This may involve using data structures like arrays or databases to store the set elements permanently.


Can you give the explanation for various operations in a queue implementation using arrays?

The following are operations performed by queue in data structuresEnqueue (Add operation)Dequeue (Remove operation)Initialize


How arrays are created in java?

Arrays are created just like other variables in Java. Ex: int[] a; // declares an array of integers a = new int[10]; // allocates memory for 10 integers a[0] = 100; // initialize first element a[1] = 200; // initialize second element Arrays are homogenous data types and hence they can contain values of only one type. If you create an integer array it can hold only integer data type values. If you try to assign values to nonexistent locations like a[15] it will throw an index out of bounds exception.


Is it necessary to initialize the const variable in c?

A constant variable cannot have its value changed at program run time.


When does segmentation fault occur for a prog?

You either reference memory that is non existent, or you attempt to modify memory that is read only. This is usually a result of failure to properly initialize or use pointers or arrays.


How you initialize an array?

by elements, like:int arr [3] = {1, 2, 3};or even: int arr [] = {1, 2, 3};character-arrays can be initialized with strings, like: char hellostr [] = "Hello";


How do you use define in C?

Just type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.


What is Jagged Array in C?

A Jagged array is an array of arrays. You can initialize a jagged array as − int[][] scores = new int[2][]{new int[]{92,93,94},new int[]{85,66,87,88}}; Where, scores is an array of two arrays of integers - scores[0] is an array of 3 integers and scores[1] is an array of 4 integers.