Skip to content

Instantly share code, notes, and snippets.

View velotiotech's full-sized avatar

Velotio Technologies velotiotech

View GitHub Profile
#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40};
int *ptr = arr;
*(ptr + 1) = 25;
ptr += 2;
*ptr = 35;
for (int i = 0; i < 4; i++)
printf("%d ", arr[++i]);
return 0;
#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40};
int *ptr = arr;
*(ptr + 1) = 25;
ptr += 2;
*ptr = 35;
for (int i = 0; i < 4; i++)
printf("%d ", arr[++i]);
return 0;
#include <stdio.h>
int main() {
int arr[] = {10, 20, 30, 40};
int *ptr = arr;
*(ptr + 1) = 25;
ptr += 2;
*ptr = 35;
for (int i = 0; i < 4; i++)
printf("%d ", arr[++i]);
return 0;
fn fill_vec(vec: Vec<i32>) -> Vec<i32> {
vec.push(88);
vec
}
fn main() {
let mut vec0 = vec![22, 44, 66];
let vec1 = fill_vec(vec0);
}
#include <iostream>
using namespace std;
int main() {
int x = 1 << 30;
int y = 1;
cout << (x << y) << endl;
return 0;
}
#include <iostream>
template <typename T>
void func(T&& t) {
T y = t;
t += 3;
std::cout << y << " ";
}
int main() {
int c = 5;
fn get_char(data: String) -> char {
data.chars().last().unwrap()
}
fn string_uppercase(mut data: &String) {
data = data.to_uppercase();
println!("{data}");
}
import Clarity from 'clarity';‍
Clarity.initialize('YOUR_CLARITY_TRACKING_CODE');
npm install clarity@latest‍ 
yarn add clarity@latest
const obj = {
value: 29,
method: function() {
const nested = () => {
console.log("LOG 1: ",this.value);
};
nested();
}
};