Variants
Views
Actions

Difference between revisions of "Cppreference:Archives"

From cppreference.com
(rvv)
Line 1: Line 1:
2. Fişierele cuv1.txt şi cuv2.txt conţin cuvinte, câte un cuvânt pe linie în ordine alfabetică. Să se construiască fişierul cuv3.txt care să conţină toate cuvintele din cele două fişiere, în ordine alfabetică.
+
{{title|Archives for offline viewing}}
  
#include <iostream.h>
+
For convenience, several versions of the wiki suitable for offline viewing are available.
#include <conio.h>
+
#include <string.h>
+
#include<fstream.h>
+
#include<stdio.h>
+
void main()
+
{char a[10], b[10], cuv[10][20], aux[10]; int i,j,nr=0;
+
clrscr();
+
fstream f(„cuv1.txt”, ios::in);
+
while(f.getline(a,10))strcpy(cuv[++nr],a);
+
ifstream g(„cuv2.txt”);
+
while(g.getline(b,10))strcpy(cuv[++nr],b);
+
  
for(i=1;i<nr;i++)
+
===Html book===
for(j=i+1;j<=nr;j++)
+
if(strcmp(cuv[i],cuv[j])>0)
+
{
+
strcpy(aux,cuv[i]);
+
strcpy(cuv[i],cuv[j]);
+
strcpy(cuv[j],aux);
+
}
+
for(i=1;i<=nr;i++)
+
cout<<cuv[i]<<endl;
+
getch();}
+
  
3. În fişierul date.in sunt scrise mai multe cuvinte câte unul pe fiecare linie din fişier. Se cere:
+
This html book is an offline copy of the website with unnecessary UI elements stripped out. Choose this if you just want to access cppreference.com via a browser while without internet connection.
a) Să se determine numărul de cuvinte din fişier;
+
b) Să se afişeze cuvintele care încep cu o vocală.
+
  
#include<iostream.h>
+
{|
#include<fstream.h>
+
| rowspan=2 style="padding-right:1em;" | 7 June 2019<br/>{{small|[[Cppreference:Old archives|Old versions]]}}
#include<string.h>
+
| [[File:html_book_20190607.zip]]
#include<conio.h>
+
|-
void main()
+
| [[File:html_book_20190607.tar.xz]]
{
+
|}
char a[10]; int k, i, nr=0;
+
clrscr();
+
fstream f(„date.in”,ios::in);
+
while(f.getline(a,10))
+
{if(a[0]==’a’||a[0]==’e’||a[0]==’i’||a[0]==’o’||a[0]==’u’) cout<<a<<endl; nr++;
+
}
+
cout<<nr;
+
}
+
  
La o staţie de benzină există mai multe maşini caracterizate prin număr, marcă şi culoare. Se cere:
+
===Raw archive===
a) Să se determine numărul maşinilor Dacia;
+
b) Să se ordoneze maşinile după culoare.
+
#include<iostream.h>
+
#include<string.h>
+
#include<conio.h>
+
typedef struct
+
{char marca[20],culoare[20],med[20];
+
int nr;}masina ;
+
masina a[20];
+
int n,x,k;
+
void citire()
+
{int i;
+
cout<<„n=”;cin>>n;
+
for (i=1;i<=n;i++)
+
{cout<<„a[i].marca: „;cin>>a[i].marca;
+
cout<<„a[i].culoare: „;cin>>a[i].culoare;
+
cout<<„a[i].numar: „;cin>>a[i].nr;
+
}
+
}
+
void nr_dacia()
+
{ int i;
+
int nr=0;
+
for (i=1;i<=n;i++)
+
{x=strcmp(a[i].marca,”dacia”);
+
if (x==0) nr=nr+1;}
+
cout<<„numarul de masini Dacia este „<<nr<<„\n”;
+
}
+
void sortare()
+
{ int i,j;masina aux;
+
  
for (i=1;i<=n-1;i++)
+
This archive is a raw copy created using [http://www.gnu.org/software/wget/ Wget]. Note that this archive is not useful for viewing as-is, please use the HTML book instead. Note: the utility scripts and a makefile are contained in this package, so it can be used as full upstream source.
for (j=i+1;j<=n;j++)
+
{x=strcmp(a[i].culoare,a[j].culoare);
+
if(x>0)
+
{aux=a[i];
+
a[i]=a[j];
+
a[j]=aux;
+
}
+
}
+
for (i=1;i<=n;i++)
+
cout<<a[i].culoare<<” „<<a[i].marca<<” „<<a[i].nr<<endl;
+
}
+
  
void main()
+
{|
{
+
| rowspan=2 style="padding-right:1em;" | 7 June 2019<br/>{{small|[[Cppreference:Old archives|Old versions]]}}
citire();
+
| [[File:cppreference-doc-20190607.zip]]
nr_dacia();
+
|-
sortare();
+
| [[File:cppreference-doc-20190607.tar.xz]]
}
+
|}
  
Pentru evidenţa produselor cosmetice dintr-un depozit, se defineşte o structură cu următoarele informaţii: codul produsului, denumire, preţul produsului. Citiţi informaţiile tuturor produselor şi afişaţi produsele cu noile preţuri (valoarea lui x este 7 dacă codul produsului este mai mic decât 500. Şi 11 în caz contrar). Afişaţi produsele cu cel mai mare preţ după scumpire.
+
===Unofficial Release===
  
#include<iostream.h>
+
An unofficial fork that is updated more frequently can be found in [https://github.com/PeterFeicht/cppreference-doc this] git repository.
#include<string.h>
+
 
#include<conio.h>
+
{|
typedef struct
+
| rowspan=3 style="padding-right:1em;" | 28 September 2019<br/>{{small|[https://github.com/PeterFeicht/cppreference-doc/releases Old versions]}}
{int cod,c,p,pret;
+
| [https://github.com/PeterFeicht/cppreference-doc/releases/download/v20190928/html-book-20190928.zip html-book-20190928.zip]  
char den[20];}produse;
+
|-
produse a[20];
+
| [https://github.com/PeterFeicht/cppreference-doc/releases/download/v20190928/html-book-20190928.tar.xz html-book-20190928.tar.xz]
int n,i,c,p;
+
|-
void citire()
+
| [https://github.com/PeterFeicht/cppreference-doc/releases/tag/v20190928 Other files (qch and raw archive)]
{
+
|}
cout<<„Dati numarul de produse „;cin>>n;
+
 
for (i=1;i<=n;i++)
+
===Devhelp book===
{cout<<„codul produsului „;cin>>a[i].cod;
+
 
cout<<„pretul produsului „;cin>>a[i].pret;
+
[https://wiki.gnome.org/Apps/Devhelp Devhelp] is a documentation browser for GTK/Gnome.
cout<<„denumirea produsului „;cin>>a[i].den;}
+
 
}
+
The book is available as {{tt|cppreference-doc-en-html}} {{tt|deb}} package in the official [https://packages.debian.org/search?keywords=cppreference&searchon=names&suite=all&section=all Debian ] and [http://packages.ubuntu.com/search?keywords=cppreference&searchon=names&suite=all&section=all Ubuntu] repositories.
void rezolvare()
+
 
{
+
For arch users, the package {{tt|cppreference-devhelp}} could be found [https://aur.archlinux.org/packages/cppreference-devhelp/ here], which can be installed from AUR by tools like yaourt.
for (i=1;i<=n;i++)
+
 
if(a[i].cod<500) a[i].pret=7;
+
===Qt help book===
else a[i].pret=11;
+
 
for (i=1;i<=n;i++)
+
{{tt|qch}} is a documentation format for use in the Qt tools such as [https://wiki.qt.io/Qt_Creator QtCreator] or [http://doc.qt.io/qt-5/qtassistant-index.html Qt Assistant].  
cout<<„pretul „<<a[i].den<<” este „<<a[i].pret<<„\n”;
+
 
cout<<endl;
+
The {{tt|qch}} book below contains a version of the html book, adapted for use with the Qt tools. Search also works.
for (i=1;i<=n;i++)
+
 
if(a[i].pret==11) cout<<a[i].den<<„\n”;
+
:'''Note''': Old versions of QtCreator or QtAssistant display the documentation improperly. If you see bad formatting, please update these programs. The oldest versions that display the contents correctly are QtCreator v3.0 and QtAssistant v4.8.6.
}
+
 
void main()
+
{|
{
+
|-
citire();
+
| rowspan=2 style="padding-right:1em;" | 7 June 2019<br/>{{small|[[Cppreference:Old archives|Old versions]]}}
rezolvare();
+
| [[File:qch_book_20190607.zip]]
}
+
|-
 +
| [[File:qch_book_20190607.tar.xz]]
 +
|}
 +
 
 +
The book is available as {{tt|cppreference-doc-en-qch}} {{tt|deb}} package in the official [https://packages.debian.org/search?keywords=cppreference&searchon=names&suite=all&section=all Debian ] and [http://packages.ubuntu.com/search?keywords=cppreference&searchon=names&suite=all&section=all Ubuntu] repositories.
 +
 
 +
The book is also provided by AUR package [https://aur.archlinux.org/packages/cppreference-qt/ cppreference-qt] for Arch Linux users.
 +
 
 +
===Doxygen tag file===
 +
[http://doxygen.nl/ Doxygen] is a tool to automatically generate documentation from source code comments. It supports automatic linking of C++ names to external documentation via [http://www.stack.nl/~dimitri/doxygen/manual/external.html tag file] functionality. Two tag files are provided in the "html book" archive mentioned above:
 +
 
 +
* '''local''': use the {{tt|cppreference-doxygen-local.tag.xml}} file to link to the local "html book" archive at the default install location.
 +
 
 +
* '''web''': {{tt|cppreference-doxygen-web.tag.xml}} to link directly to the cppreference.com website.
 +
 
 +
 
 +
In order to support external cppreference documentation, Doxyfile needs to be modified as follows:
 +
 
 +
* If the link target is local archive, add the following line:
 +
 
 +
{{tt|1=TAGFILES += "location/of/cppreference-doxygen-local.tag.xml=/location/of/html/book/root/"}}
 +
 
 +
* If the link target is cppreference.com, add the following line:
 +
 
 +
{{tt|1=<nowiki>TAGFILES += "location/of/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"</nowiki>}}
 +
 
 +
===Manpages===
 +
 
 +
Automatically generated man pages are maintained [https://github.com/jeaye/stdman here]. Installation notes are included in the README and updates follow the offline archive releases.
 +
 
 +
===Bugs===
 +
 
 +
All bugs in the offline archives should be reported either to the [http://en.cppreference.com/w/Cppreference_talk:Archives talk page] or to the [https://github.com/p12tic/cppreference-doc/issues issues page] of the cppreference-doc github project.
 +
 
 +
===See also===
 +
 
 +
The utility scripts are maintained in [http://github.com/p12tic/cppreference-doc this] git repository.
 +
 
 +
The debian packaging information is maintained in [http://github.com/p12tic/cppreference-doc-debian this] git repository.
 +
 
 +
An independently-maintained CHM (Windows help) archive can be found in [https://github.com/crea7or/cppreference2mshelp this] git repository.
 +
 
 +
 
 +
{{langlinks|ja|zh}}

Revision as of 06:31, 16 January 2020


For convenience, several versions of the wiki suitable for offline viewing are available.

Contents

Html book

This html book is an offline copy of the website with unnecessary UI elements stripped out. Choose this if you just want to access cppreference.com via a browser while without internet connection.

7 June 2019
Old versions
File:html book 20190607.zip
File:html book 20190607.tar.xz

Raw archive

This archive is a raw copy created using Wget. Note that this archive is not useful for viewing as-is, please use the HTML book instead. Note: the utility scripts and a makefile are contained in this package, so it can be used as full upstream source.

7 June 2019
Old versions
File:cppreference-doc-20190607.zip
File:cppreference-doc-20190607.tar.xz

Unofficial Release

An unofficial fork that is updated more frequently can be found in this git repository.

28 September 2019
Old versions
html-book-20190928.zip
html-book-20190928.tar.xz
Other files (qch and raw archive)

Devhelp book

Devhelp is a documentation browser for GTK/Gnome.

The book is available as cppreference-doc-en-html deb package in the official Debian and Ubuntu repositories.

For arch users, the package cppreference-devhelp could be found here, which can be installed from AUR by tools like yaourt.

Qt help book

qch is a documentation format for use in the Qt tools such as QtCreator or Qt Assistant.

The qch book below contains a version of the html book, adapted for use with the Qt tools. Search also works.

Note: Old versions of QtCreator or QtAssistant display the documentation improperly. If you see bad formatting, please update these programs. The oldest versions that display the contents correctly are QtCreator v3.0 and QtAssistant v4.8.6.
7 June 2019
Old versions
File:qch book 20190607.zip
File:qch book 20190607.tar.xz

The book is available as cppreference-doc-en-qch deb package in the official Debian and Ubuntu repositories.

The book is also provided by AUR package cppreference-qt for Arch Linux users.

Doxygen tag file

Doxygen is a tool to automatically generate documentation from source code comments. It supports automatic linking of C++ names to external documentation via tag file functionality. Two tag files are provided in the "html book" archive mentioned above:

  • local: use the cppreference-doxygen-local.tag.xml file to link to the local "html book" archive at the default install location.
  • web: cppreference-doxygen-web.tag.xml to link directly to the cppreference.com website.


In order to support external cppreference documentation, Doxyfile needs to be modified as follows:

  • If the link target is local archive, add the following line:

TAGFILES += "location/of/cppreference-doxygen-local.tag.xml=/location/of/html/book/root/"

  • If the link target is cppreference.com, add the following line:

TAGFILES += "location/of/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"

Manpages

Automatically generated man pages are maintained here. Installation notes are included in the README and updates follow the offline archive releases.

Bugs

All bugs in the offline archives should be reported either to the talk page or to the issues page of the cppreference-doc github project.

See also

The utility scripts are maintained in this git repository.

The debian packaging information is maintained in this git repository.

An independently-maintained CHM (Windows help) archive can be found in this git repository.