Search
 
SCRIPT & CODE EXAMPLE
 

CPP

1d array

//y * rows + x

for(int y = 0; y < rows; y++)
{
    for(int x = 0; x < cols; x++)
    {
        int point = grid[y * rows + x];
    }
}
Comment

1d array

//C - program to create 1D array using data taken from user

#include <stdio.h>
void main(){
int i,a[100],n;
printf("Enter the no of elements of 1D array:	");
scanf("%d",&n);
printf("Enter the %d elements of the array",n);
for(i = 0; i<n;i++)
{
	scanf("%d",&a[i]);
}
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ template function 
Cpp :: how to send email in c++ program 
Cpp :: C++ program that prints the prime numbers from 1 to 1000. 
Cpp :: comparator for priority queue c++ 
Cpp :: update variable in const function C++ 
Cpp :: pop_back 
Cpp :: functors in c++ 
Cpp :: hello world program in c++ 
Cpp :: c++ remove text file 
Cpp :: console colors in C++ 
Cpp :: c++ set comparator 
Cpp :: insert only unique values into vector 
Cpp :: factorial function c++ 
Cpp :: how to initialize a vector of pairs in c++ 
Cpp :: c++ int to char* 
Cpp :: push local branch to another remote branch 
Cpp :: power of two c++ 
Cpp :: cin getline 
Cpp :: classes and objects in c++ 
Cpp :: integer range in c++ 
Cpp :: how to compare two char* in c++ 
Cpp :: Convert a hexadecimal number into decimal c++ 
Cpp :: slice a vector c++ 
Cpp :: quicksort geeksforgeeks 
Cpp :: input full line as input in cpp 
Cpp :: stl c++ 
Cpp :: two elements with difference K in c++ 
Cpp :: how to initialize a queue in c 
Cpp :: opencv c++ feature detection 
Cpp :: c++ Attribute Parser 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =