the output'MessageBox (buf );Fclose (pFile );Garbled characters appear because '/0' is not found in time during the output file. Change strlen of the file to sizeof.When a file read/write function needs to read/write, it carries '/0'. It is similar to functions such as printf and strlen that end with'/0' as the function.Garbled code can also be usedFILE * pFile = fopen ("c: // 1.txt"," r ");Char buf [100];Fseek (pFile, 0, SEEK_END );Long len = ftell (pFile );Rewind (pFile );Fread (buf, 1, len,
[Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]
Awk has many built-in variables used to set environment information. These variables can be changed. The following are the built-in variables of awk:
Number of argc command line parameters
Argv command line parameter arrangement
Environ supports the use of system environment variables in the queue
Filename a w k browsed file name
Number of FNR browsing file records
FS sets the inpu
problems. Please refer to the following Program :# I nclude Int iarray [2] = {99,10 };Void main (){Ofstream OS ("test. dat ");OS. Write (char *) iarray, sizeof (iarray ));}When the execution program outputs data to the file, 10 is automatically converted to 13. However, the conversion here is obviously not what we need. To solve this problem, we need to use the binary mode output. When binary mode is used for output, the characters in the output are not converted. The following methods can be u
-file records do not increment, each file starts from 1 \ T tab \ n line break FS begin when defining separators RSEnter the record delimiter, which defaults to a newline character (that is, the text is entered as one line)~ match, compared to = = not accurate comparison!~ mismatch, imprecise comparison = = equals, must all equal, exact comparison! = Not equal, exact comparison logic with | | A logical OR + match represents 1 or more/[0-9][0-9]+/or more than two or more digits/[0-9][0-9]*/one o
-file record increment FNR is similar to NR, but multi-file records do not increment, each file starts from 1 \ T tab \ n line break FS begin when defining separators RSEnter the record delimiter, which defaults to a newline character (that is, the text is entered as one line)~ match, compared to = = not accurate comparison!~ mismatch, imprecise comparison = = equals, must all equal, exact comparison! = Not equal, exact comparison logic with | | A logical OR + match represents 1 or more/[0-9][0
engaged in mental work are in the office every day, whether they are senior executives or office staff, whether they are group CEOs or big company managers, the orientation of the Office and indoor decoration are crucial. Because Geely's aura is helpful to human strategy, courage, wisdom, fortune, and career, it is more advantageous to exert its talents and talents, the office environment will naturally affect the correctness of decision-making, the success or failure of the business, and the r
) ;}
Serialized person class:
Person. h
class Person {public:Person() ;Person(int _age, std::string _name) ;~Person() ;void addScore(const float _score) ;private:friend class boost::serialization::access ;template
Test procedure:
Person onePerson(25, "fang") ;onePerson.addScore(95.2f) ;std::ofstream ofs("out.bin", std::ios_base::binary) ;if (ofs.is_open()){boost::archive::binary_oarchive oa(
explaining that Awk is a line of processing textawk ' {print ' a '} '/etc/passwd//Output the same number of a line, a line only a letter Aawk-f ":" ' {print $} '/etc/passwd awk-f: ' {print $; print $ ' /etc/passwd // The first two fields of each row, branch output, further understanding a line of processing textawk-f: ' {print $1,$3,$6} ' ofs= ' \ t '/etc/passwd // output field 1,3,6, with TAB as delimiter- F Specify script fileawk-f Script.awk
sensitivity in regular expressions and string operations. The number of NF file domains. The number of records of the current NR file. OFMT digital output format. OFS output domain separator. ORS output record delimiter. The length of the string matching by the match function. RS input record delimiter. The offset of the string matching by the match function. SUBSEP subscript delimiter.
/> Cat employees2Tom Jones: 4424: 5/12/66: 543354Mary Adams: 534
also be noted that the header files used by scanf and printf should be stdio.h instead of iostream.I do not know this pair of functions to live today, before encountering Cin Tle always foolishly changed to scanf, and even believe that C + + in the IO aspect of inefficient nonsense, but this is only C + + to be compatible with C and take the conservative measures.TieThe tie is a function that binds two stream, and the null argument returns the current output stream pointer.
#include
#in
Menu
Take a look at the menu style below. Because the style is more, so 8 buttons share a menu div ID
MEUN1 MEUN2 MEUN3 MEUN4 MEUN5 MEUN6 MEUN7 MEUN8 Enigma DESK for iconEnigma DESK for SkinEnigma DESK for ImageEnigma DESK Basic BBSMEUN9 MEUN10 MEUN12 MEUN13 MEUN14 MEUN15 MEUN16 MEUN17 Enigma
Inherited: Inheritance is a relatively central concept in object-oriented. Other Orthodox object-oriented languages can be implemented in two ways Commitment: One is an interface implementation, and the other is inheritance. While ECMAScript only supports inheritance, it does not support interface implementations, and realThe way it is inherited relies on the prototype chain to complete.function Box () {//box constructionThis.name= ' Lee ';}function Desk
first, JavaScript implements the three-layer meaning of inheritance:instances of the ① subclass can share methods of the parent class;② subclasses can override the methods of the parent class or extend a new method;both the ③ subclass and the parent class are instances of subclasses.
Second, the implementation of several methods of inheritance:1. Prototype chain inheritanceExample: function Box () {//inherited functions are called super (parent) type;this.name = "Andy"; }function
box = new MyString (' Lee '); Much more tedious than adding directly to the reference prototypeAlert (box.addstring ());In some secure environments, such as prohibit the use of this and new, this is the constructor that does not use this,The new here is to not use new when instantiating the constructor externally. This method of creation is called a secure constructor.function Box (name, age) {var obj = new Object ();Obj.run = function () {Return name + Age + ' running ... '; Direct printing of
Because the scaffolding was used to create the project, the first time to learn to create Webpack packaging. Loader I was copying someone else's.Module: { loaders: [ { test:/\.js?$/, exclude:/(Node_modules)/, loader: ' Babel-loader ', Query: { presets: [' react ', ' es2015 '} } ] },The results were packed with an error.ERROR in./js/index.jsModule build Failed:error:plugin/preset files is not allowed to export objects, only functions. In I:\
===============================================================Boolean operator|| #逻辑或 #逻辑与! #逻辑非 Print out rows with UID equal to 10 in the/etc/passwd file or GID equals 10#awk ' BEGIN {fs= ': '} {if ($3==10| | $4==10) print $} '/etc/passwdPrints out the/etc/passwd file with UID equal to GID, and the login shell has the same matching information#awk ' BEGIN {fs= ': '} {ofs= ': '} {if ($3==$4$7= "/sbin/nologin") print $} '/etc/passwdPrint out matchin
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.