This file contains 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> | |
using namespace std; | |
// clang++ -std=c++11 -stdlib=libc++ -Weverything mergesort.cpp | |
vector<int> merge_sort(vector<int> v); | |
vector<int> merge(vector<int> left, vector<int> right); | |
ostream& operator << (ostream& os, vector<int> v); |
This file contains 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 <memory> | |
struct A | |
{ | |
virtual void process(); | |
}; | |
struct B : public A | |
{ |
This file contains 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> | |
int main() | |
{ | |
char pre [4] = "123"; | |
char buf [4] = "123"; | |
char post[4] = "123"; | |
std::cin.width(3); | |
std::cin >> buf; | |
std::cout << pre << "," << buf << "," << post << std::endl; |
This file contains 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> | |
void f(int) { std::cout << "f(int)" << std::endl; } | |
void f(char *) { std::cout << "f(char *)" << std::endl; } | |
int main() | |
{ | |
std::cout << "hello world" << std::endl; | |
This file contains 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> | |
void f(int) { std::cout << "f(int)" << std::endl; } | |
void f(char *) { std::cout << "f(char *)" << std::endl; } | |
int main() | |
{ | |
std::cout << "hello world" << std::endl; | |
This file contains 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> | |
void f(int) { std::cout << "f(int)" << std::endl; } | |
void f(char *) { std::cout << "f(char *)" << std::endl; } | |
int main() | |
{ | |
std::cout << "hello world" << std::endl; | |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <sys/socket.h> | |
#include <ace/OS.h> |
This file contains 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 <unistd.h> | |
int main() | |
{ | |
{ | |
char name [1024] = ""; | |
const int result = gethostname( name, sizeof name ); | |
std::cout << "result [" << result << "] name[" << name << "]" << std::endl; | |
} |
This file contains 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 <ace/Semaphore.h> | |
#include <iostream> | |
int main() | |
{ | |
std::cout << "hello wordl" << std::endl; | |
ACE_Semaphore signal( 0, USYNC_THREAD, "test_ACE_sem" ); | |
signal.dump(); | |
signal.release(); |
This file contains 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 "semaphore.h" | |
int main() | |
{ | |
std::cout << "hello world" << std::endl; | |
sem_t temp; | |
const int result = sem_init( &temp, 0, 0 ); | |
std::cout << " result = [" << result << "]" << std::endl; |
NewerOlder