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 <string.h> | |
void foo (char *bar) | |
{ | |
char c[12]; | |
strcpy(c, bar); // no bounds checking | |
} | |
int main (int argc, char **argv) |
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> | |
using namespace std; | |
int main ( int argc, char *argv[] ){ | |
cout << argc << " arguments" << endl; | |
for(int i=0; i < argc; i++){ | |
cout << "Arg " << i << ": " << argv[i] << endl; | |
} | |
return 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
THE PREAMBLE | |
In the name of God, the most merciful, the most compassionate | |
We have honored the sons of Adam. | |
We are the people of the land between two rivers, the homeland of the apostles and prophets, abode of the virtuous imams, pioneers of civilization, crafters of writing and cradle of numeration. Upon our land the first law made by man was passed, the most ancient just pact for homelands policy was inscribed, and upon our soil, companions of the Prophet and saints prayed, philosophers and scientists theorized and writers and poets excelled. | |
Acknowledging God's right over us, and in fulfillment of the call of our homeland and citizens, and in response to the call of our religious and national leaderships and the determination of our great (religious) authorities and of our leaders and reformers, and in the midst of an international support from our friends and those who love us, marched for the first time in our history toward the ballot boxes by the millions, men and women, young and old, on the thir |
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
We the People of the United States, in Order to form a more perfect Union, | |
establish Justice, insure domestic Tranquility, provide for the common | |
defence, promote the general Welfare, and secure the Blessings of Liberty to | |
ourselves and our Posterity, do ordain and establish this Constitution for the | |
United States of America. | |
Article 1. | |
Section 1 | |
All legislative Powers herein granted shall be vested in a Congress of the |
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 <gmp.h> | |
using namespace std; | |
int main(){ | |
mpz_t x,y,z; | |
mpz_init(x); | |
mpz_init(y); | |
mpz_init(z); | |
mpz_set_str(x, "1234567890123456789012345678901234567890", 10); |
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 <string> | |
using namespace std; | |
//Classic Linked List | |
template<typename DataType> | |
struct Node { | |
Node<DataType>* next; | |
DataType data; |
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> | |
using namespace std; | |
int main() { | |
int* p2int; | |
*p2int = 23; | |
cout << *p2int << 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
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
int main(){ | |
int* x = (int*) malloc(32); | |
x[0] = 23; | |
cout << x[0] << 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
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
using namespace std; | |
int main(){ | |
srand(time(0)); | |
int even = 0; | |
int odd = 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 <iostream> | |
#include <algorithm> | |
#include <functional> | |
#include <iterator> | |
using namespace std; | |
int main() | |
{ | |
int coll[] = { 5, 6, 2, 4, 1, 3 }; |