Skip to content

Instantly share code, notes, and snippets.

View satishgoda's full-sized avatar

Satish Goda satishgoda

View GitHub Profile
@satishgoda
satishgoda / 0_blender.crash.files
Last active January 3, 2016 23:19
Crash Report for # Blender 2.69 (sub 8), Commit date: 2014-01-12 19:10, Hash c925b5b
When blender crashes
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <cstdlib>
int main(int argc, char* argv[])
{
using namespace std;
@satishgoda
satishgoda / enum_class_1.cpp
Last active January 1, 2016 22:28
Enumeration Classes
#include <iostream>
#include <string>
using namespace std;
enum class TrafficLight { green, yellow, red };
TrafficLight& operator++(TrafficLight& light) {
switch (light) {
case TrafficLight::green:
return light = TrafficLight::yellow;
#include <iostream>
#include <iomanip>
#include <type_traits>
#include <typeinfo>
#include <typeindex>
class A { };
class A1 { char c; };
#include <stdio.h>
#include <stdlib.h>
int argcorig = 0;
char **argvorig = NULL;
char **envorig = NULL;
char **arg = NULL;
char **env = NULL;
typedef void (*exitcallback) ();
@satishgoda
satishgoda / prncmdlinerev.c
Last active January 1, 2016 17:29
./a.out Abc Def Ghi ihG feD cbA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
char **arg = argv + argc -1;
while(arg > argv) {
char *sptr = *arg + strlen(*arg) - 1;
@satishgoda
satishgoda / lll_test.c
Last active January 1, 2016 12:39
Linear Linked Lists
#include <stdio.h>
#include <stdlib.h>
typedef struct Node
{
int info;
struct Node *link;
} Node;
@satishgoda
satishgoda / cmdlineargs.c
Last active January 1, 2016 10:09
Command-line arguments in C
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("argc=%d program name=[\"%s\"]\n", argc, argv[0]);
printf("%d \n", argc == ((argv + argc) - argv) );
if (argc < 2) {
@satishgoda
satishgoda / 0_pointers_basics.c
Last active January 1, 2016 00:28
Pointer Arithmetic in C
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
char *ntsp = "Hello";
// Printing null-terminated strings
{
@satishgoda
satishgoda / helloWorld.c
Last active December 31, 2015 21:59
Hello World in C
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("%s %s\n", "Hello", "World");
return 0;
}