All Projects → fredsiika → 30-seconds-of-c

fredsiika / 30-seconds-of-c

Licence: GPL-3.0 license
🔌Curated collection of useful C Programming tutorials, snippets, and projects that you can understand in 30 seconds or less.

Programming Languages

javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language
HTML
75241 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to 30-seconds-of-c

the-c-programming-language-2nd-edition-solutions
Solutions to the exercises in the book "The C Programming Language" (2nd edition) by Brian W. Kernighan and Dennis M. Ritchie. This book is also referred to as K&R.
Stars: ✭ 245 (+744.83%)
Mutual labels:  c-language, c-programming
C-Programs
A Repository full of C-Programs. 🙂
Stars: ✭ 14 (-51.72%)
Mutual labels:  c-programming, c-programms
C-Programming
C Programming Experiments
Stars: ✭ 25 (-13.79%)
Mutual labels:  c-language, c-programming
Lowlevelprogramming University
How to be low-level programmer
Stars: ✭ 7,224 (+24810.34%)
Mutual labels:  c-programming
stress
Single-purpose tools to stress resources
Stars: ✭ 24 (-17.24%)
Mutual labels:  c-language
recurrent-neural-net
A recurrent (LSTM) neural network in C
Stars: ✭ 68 (+134.48%)
Mutual labels:  c-programming
Programming-language-QA
C/C++/Java/Python 基础知识总结
Stars: ✭ 73 (+151.72%)
Mutual labels:  c-programming
C
Computer Programming, Khwopa College of Engineering
Stars: ✭ 12 (-58.62%)
Mutual labels:  c-programming
async2.h
Stackful Async Subroutines for C. Brings async 2 C
Stars: ✭ 87 (+200%)
Mutual labels:  c-language
CinderOS
👨‍💻An operating system, built from scratch in C.
Stars: ✭ 26 (-10.34%)
Mutual labels:  c-programming
algorithms
A open source repository of different kinds of algorithms in c. Newbies are encouraged to contribute! Note: I made this code when i didn't have as much experience in programming
Stars: ✭ 33 (+13.79%)
Mutual labels:  c-programming
pkcs11-tools
A set of tools to manage objects on PKCS#11 crypotographic tokens. Compatible with any PKCS#11 library, including NSS.
Stars: ✭ 70 (+141.38%)
Mutual labels:  c-language
ft select
A robust file browser and manager in the terminal.
Stars: ✭ 14 (-51.72%)
Mutual labels:  c-programming
mescc
Mike's Enhanced Small C Compiler for Z80 and CP/M.
Stars: ✭ 23 (-20.69%)
Mutual labels:  c-language
rb tree
Red-black tree C implementation
Stars: ✭ 33 (+13.79%)
Mutual labels:  c-language
Fstar
A Proof-oriented Programming Language
Stars: ✭ 2,171 (+7386.21%)
Mutual labels:  c-language
Learn-to-program-with-C AR
ترجمة لدرس تعلّم البرمجة بلغة السي الخاص بموقع OpenClassrooms
Stars: ✭ 51 (+75.86%)
Mutual labels:  c-language
ric-script
My own modern scripting language; implemented in C using old school yacc & flex
Stars: ✭ 25 (-13.79%)
Mutual labels:  c-programming
Cuik
A Modern C11 compiler (STILL EARLY)
Stars: ✭ 102 (+251.72%)
Mutual labels:  c-language
physfs-old
UNOFFICIAL Git mirror of PhysicsFS Mercurial repository. The official repository has also moved to GitHub; this one will no longer be updated. Official website:
Stars: ✭ 53 (+82.76%)
Mutual labels:  c-language

30-Seconds-of-C-Logo

30 Seconds of C

PRs WelcomeAwesomeLicense


🔌Your plug to a curated collection of useful C Programming tutorials, snippets, and projects that you can understand in 30 seconds or less.



P.S: This repository is a work in progress

Getting Started

  • Use Ctrl + F or command + F to search for a snippet.
  • Contributions welcome, please read the contribution guide.

Motivation for this project The core goal of 30 seconds of C is to provide a public record of my journey to learn c programming. It's my goal to provide a quality resource for both beginners and advanced c progammers/developers. My initial motivation for creating this repository was to use it as a tool to document my journey at the 42 Silicon Valley - an engineering and programming. The contents of this repo are designed to help you write real time C programs on your own.

Table of Contents

📃Basic Data Types

View contents

Integer

Character

  • char

Floating Point

  • float
  • Double

Enumeration Data Type

View contents

📚Derived Data Type

View contents

🎛️Void Data Type

View contents

Exam Shell

Purpose: This repo provides useful tips to understand how to achieve 100% at 42 Silicon Valley exams. A great developer like you 😎, however, should not just memorize the answers.


aff_a

Create a program that takes a string, and displays the first 'a' character it encounters in it, followed by a newline. If there are no 'a' characters in the string, the program just writes a newline. If the number of parameters is not 1, the program displays 'a' followed by a newline.

$> ./aff_a "abc" | cat -e
a$
$> ./aff_a "dubO a POIL" | cat -e
a$
$> ./aff_a "zz sent le poney" | cat -e
$
$> ./aff_a | cat -e
a$
Answer
#include <unistd.h>

int	main(int argc, char **argv)
{
	if (argc != 2)
		write(1, "a", 1);
	else
	{
		while (*argv[1])
			if (*argv[1] == 'a')
			{
				write(1, "a", 1);
				argv[1]++;
				break;
			}
	}
	write(1, "\n", 1);
	return (0);
}


Back to top

ft_countdown

Write a program that displays all digits in descending order, followed by a newline.

$> ./ft_countdown | cat -e
9876543210$
$>
Answer
#include <unistd.h>

int	main(void)
{
	char c;
	c = '9';
	while (c >= '0')
	{
		write(1, &c, 1);
		c--;
	}
	write(1, "\n", 1);
	return (0);
}


Back to top

ft_print_numbers

Write a function that displays all digits in ascending order.

Your function must be declared as follows:

void ft_print_numbers(void);

Answer
#include <unistd.h>

int	main(void)
{
	char c;

	c = '0';
	while (c <= '9')
	{
		write(1, &c,1);
		c++;
	}
	write(1, "\n", 1);
	return (0);
}


Back to top

Additional Learning Resources

If you are new to C Programming, try taking a look at some of these references.

Books


  • ANSI 89 – American National Standards Institute, American National Standard for Information Systems Programming Language C, 1989.
  • Kernighan 78 – B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall: Englewood Cliffs, NJ, 1978. Second edition, 1988.
  • Thinking 90 – C* Programming Guide, Thinking Machines Corp. Cambridge Mass., 1990.
  • Head First C - A complete learning experience for C and structured imperative programming.

Websites


Online Integrated Development Environments (IDEs)

Inspiration for this project

The idea behind 30 Seconds of C was inspired some people who created similar collections in other programming languages and environments. Here are the ones we like the most:

How to Contribute

Do you have a cool idea for a new snippet, or want to add your own tips? Checkout contributing.md.

Collaborators


Fred Siika

Grace Nelore

Credits

Icon made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY.
This site was built using GitHub Pages.


Back to top

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].