Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pendeklarasian predefined macro [c++ example]
#1
c0de......

// learn to use predefined macros
//
// author : Paulus 'C++ Mercenary' Gandung
//
// OR call me : syn_mercs a.k.a syn-attack
//
// about output c0ntr0l : use std::cout or printf (syntax : std::cout << _output_value << std::endl; OR fprintf("%d\n", streamsize::variable_name);
//
// if you want to write it into stream_buf you must type it after declaration and process (fprintf("%d\n", variable_name/&variable_name))
//
// about newline control OR endline control, use std::endl or '\n'
//
// about input c0ntr0l : use std::cin 0R c0mbination both fprintf/printf and scanf/fscanf
//
// c0pyright @2011 : by Paulus Gandung Prakosa

#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <conio.h>

#define f(x) 2*x*x + 3*x + 1
#define _CHAR_UNSIGNED

using namespace std;

typedef unsigned int _num;
typedef unsigned long long int _long_num;
typedef signed int _sign;
typedef unsigned char _sentence;
typedef char* _pointer;

class _syn_port {
public:
_num n1;
_num n2;
_pointer string1;
_syn_port() {
}
~_syn_port() {
}
inline void get_value() {
n1 = 6;
n2 = 5;
cout << n1*n2 << endl;
}

inline void get_value_of_string() {
string1 = "Paulus Gandung Prakosa";
cout << string1 << endl;
}
};

int main(int argc, char *argv[])
{
unsigned int value_to_define = 5;
unsigned int value_to_define2 = 40;
unsigned int value_to_define3 = 50;
_syn_port syn;
syn.get_value_of_string();
cout << f(5) << endl;
syn.get_value();

return 0;
getch();
}











Reply
#2
ini script untuk apa ?
=====================
im back
Reply
#3
cuma berisi tata cara pendeklarasian predefined macro kakak,,, maaf yang sebesar2nya kalau membingungkan.... :D
Reply


Forum Jump:


Users browsing this thread: