Skip to content

Instantly share code, notes, and snippets.

@morganwilde
morganwilde / data.c
Last active August 29, 2015 13:56 — forked from Kablys/data
int data[4], // Allocates an array of type int with 4 elements
i; // Allocates an int
for(i = -8; // Initializes i to -8
i < 10;
i++) // Increments i by 1
printf("%d\n", data[i]);// This will generate an error when i is in [-8, 0)u(3, 9]
// This ^ will iterate over the following values
// -8
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
typedef int bool;
#define true 1
#define false 0
typedef struct{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
typedef int bool;
#define true 1
#define false 0
typedef struct{
void Get (struct KNYGA a[], int *i)
{
int t;
for(t=0; t<*i; t++)
{
strcpy(a[t].pavadinimas, a[t+1].pavadinimas);
strcpy(a[t].autorius, a[t+1].autorius);
a[t].puslapiu = a[t+1].puslapiu;
a[t].metai = a[t+1].metai;
a[t].versta = a[t+1].versta;