This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
void reverse (char str[]) | |
{ | |
static char temp[100]; | |
static int i = 1; | |
static int first = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <math.h> | |
#define MAXOP 100 | |
#define NUMBER '0' | |
#define MAXBUFFER 1000 | |
#define TRUE 1 | |
#define FALSE 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
void copy (char to[], char from[]) { | |
int i = 0; | |
for (; (to[i] = from[i]) != '\0'; ++i ); | |
} | |
char intChar (int n) { | |
return (n >= 0 && n <= 9) ? n + 48 : ' '; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void expand (char s1[], char s2[]) | |
{ | |
int i = 0, n, x = 0; | |
if (s1[i] >= 'a' && s1[i + 1] == '-' && s1[i + 2] <= 'z') { | |
if (s1[i + 3] == '-' && (s1[i + 2] >= s1[i] && s1[i + 2] <= s1[i + 4]) && s1[i + 4] <= 'z') { | |
for (n = s1[i]; n <= s1[i + 4]; ++n, ++x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
size_t getlen (char arr[]) | |
{ | |
int sz = 0; | |
for (; arr[sz] != '\0'; ++sz); | |
return sz; | |
} | |
void printStr (char arr[]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int getLength (char s[]) { | |
int sz = 0; | |
for (; s[sz] != '\0'; ++sz); | |
return sz; | |
} | |
int pow (int c, int n) { | |
int i = 0, v = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void scanComment (int); | |
void scanBraces (); | |
void scanParen (); | |
void scanDquote (); | |
void scanSquote (); | |
int main () | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <typeinfo> | |
class Base { | |
public: | |
virtual ~Base () { } /// we need to defined this as virtual for dynamic type destructors | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "EngineHandler.hpp" | |
/* | |
implementation file | |
*/ | |
namespace EngineHandler { | |
MainEngineHandler::MainEngineHandler ( const std::string &errMsg, const int &errCode ) try : /// initializes a constructor with a try block and catch block handler for exception purposes | |
errorMsg ( errMsg ), errorCode ( errCode ) { } catch ( std::runtime_error &e ) { | |
std::cerr << e.what () << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Algorithms: # wrap them as a class | |
def __init__ (self): # default method instantiation | |
return | |
def BubbleSort (self, param, sortMethod): # bubblesort implementation | |
i = 1 | |
temp = 0 | |
if (sortMethod == "ascending"): | |
for i in range(len(param)): |