Песочница

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
(4)
(Пример: исходник Boost)
Строка 134: Строка 134:
|type=boost
|type=boost
|code=
|code=
-
#include <stdio.h>
+
// char_sep_example_1.cpp
 +
#include <iostream>
 +
#include <boost/tokenizer.hpp>
 +
#include <string>
-
void f(void);
+
int main()
-
 
+
-
int main(void)
+
{
{
-
   int i;  
+
   std::string str = ";;Hello|world||-foo--bar;yow;baz|";
-
   for(i=0; i<10; i++) f();
+
  typedef boost::tokenizer<boost::char_separator<char> >
-
   return 0;
+
    tokenizer;
 +
  boost::char_separator<char> sep("-;|");
 +
  tokenizer tokens(str, sep);
 +
   for (tokenizer::iterator tok_iter = tokens.begin();
 +
      tok_iter != tokens.end(); ++tok_iter)
 +
    std::cout << "<" << *tok_iter << "> ";
 +
  std::cout << "\n";
 +
   return EXIT_SUCCESS;
}
}
-
 
-
void f(void)
 
-
{
 
-
  int j = 10;
 
-
  printf("%d ", j);
 
-
  j++;  /* this line has no lasting effect */
 
-
}
 
}}
}}

Версия 20:59, 11 января 2009

Содержание

Пример списка

1

  1. one
  2. two
//
      Строка 1
      Строка 2
      Строка 3
 
      Строка 1
      Строка 2
      Строка 3
  1. three
    1. three point


2

  1. one
          Строка 1
    
     Строка 2
     Строка 3
     Строка 1
     Строка 2
     Строка 3
##three point two


3

  1. one
  2. two
          Строка 1
          Строка 2
          Строка 3
        
          Строка 1
          Строка 2
          Строка 3
        
  3. three
    1. three point one
    2. three point two


4

  1. one
  2. two
    //-----
          QLabel lbl1;
          QString str;
          Строка 3
     
          Строка 1
          Строка 2
          Строка 3
    //-----
          QLabel lbl1;
          QString str;
          Строка 3
     
          Строка 1
          Строка 2
          Строка 3
  3. three
    1. three point one
    2. three point two

Пример: исходник C/C++

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник ACE

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник Boost


GeSHi Error: GeSHi could not find the language world (using path /var/www/crossplatform.ru/wiki/extensions/SyntaxHighlight_GeSHi/geshi/geshi/) (code 2)

Вы должны указать язык следующим образом: <source lang="html4strict">...</source>

Поддерживаемые языки:

abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp, cpp-qt, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, php, php-brief, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, z80

Пример: исходник GTK+

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник Qt

//
    QString locale = QLocale::system().name(); // запрос языка (например: "ru")
    QTranslator* translator = new QTranslator; 
    translator->load(QString("qt_") + locale); // загрузка файла qt_*.qm
    app.installTranslator(translator);         // устанока переводчика

Пример: исходник WxWidgets

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Geshi test

<geshi lang=cpp lines=0 source=SOURCE>#include <stdio.h>

void f(void);

int main(void) {

 int i; 
 for(i=0; i<10; i++)  f();
 return 0;

}

void f(void) {

 int j = 10;
 printf("%d ", j);
 j++;  /* this line has no lasting effect */

}</geshi>