![]() |
|
pendeklarasian predefined macro [c++ example] - Printable Version +- HN-Community (https://hacker-newbie.org) +-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html) +--- Forum: Coding/Programing (https://hacker-newbie.org/forum-19.html) +---- Forum: Aplication Programing (https://hacker-newbie.org/forum-39.html) +---- Thread: pendeklarasian predefined macro [c++ example] (/thread-7191.html) |
pendeklarasian predefined macro [c++ example] - syn_attack - 02-15-2011 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(); } RE: there's just an example..... :D - Dika_xb - 02-15-2011 ini script untuk apa ? RE: there's just an example..... :D - syn_attack - 02-15-2011 cuma berisi tata cara pendeklarasian predefined macro kakak,,, maaf yang sebesar2nya kalau membingungkan.... :D |