Strings Functions in C (original) (raw)
Related papers
Copying and Concatenating C Strings with the str5 Functions
International Journal of Computer Applications, 2015
The copy and the concatenation of strings constitute a recurring subject of polemics within the C programmers community. They generally relate to the respective advantages and disadvantages of the three principal couples of functions which are strcpy()/strcat(), strncpy()/strncat() and strlcpy()/strlcat(). This article describes two new functions str5cpy() and str5cat() which were designed to replace those functions while bringing clearness, coherence, safety and facility of use which the preceding functions lack more or less. The central point of the str5cpy() and str5cat() functions is their articulation around 5 parameters (and not 2 or 3) which will enable them to deal with the various checks, sources of many errors when they are not or badly done by the programmer, and which provide a truly significant return value indicating the action actually carried out.
The computing world has undergone a revolution since the publication of The C Programming Language in 1978. Big computers are much bigger, and personal computers have capabilities that rival mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system.
A Study in String Processing Languages
Lecture Notes in Computer Science, 1985
CONTENTS iii PREFACE vii PART I: String Processing Languages iv CONTENTS 2.4. A comparison of two backtracking models 21 2.4.1. Common definitions for the two models 21 2.4.2. The immediate/conditional model 23 2.4.2.t. Overview 23 2.4.2.2. Formal description 25 2.4.3. The recovery model 31 2.4.3.1. Overview 31 2.4.3.2. Formal description 33 2.5. Unification of pattern and expression language 35 2.6. References for Chapter 2 36 3. AN OVERVIEW OF THE SUMMER PROGRAMMING LANGUAGE 38
Comparing the performance of string operations across programming languages
2020
Abstract. In this thesis, the performance of string operations are compared across programming languages. Handling strings effectively is important especially when performance is a crucial factor and large string sizes may emerge. Common examples where large string sizes emerge are during digitalization of a product, reading string data from a database, reading and handling large CSV-files and Excel-files, converting file format to another file format (e.g. CSV to Excel and vice versa), and reading and handling a DOM-tree of a website. There has been a lot of corresponding research where programming languages are benchmarked, but none of them focus directly on string operations. The main goal of this thesis is to fill this gap in literature and try to find out which programming languages have the best results on string operations in terms of execution time and memory (maximum RSS) usage. The test environment was formed by creating randomly generated string files with sizes varying f...
A Practical String Analyzer by the Widening Approach
The static determination of approximated values of string expressions has many potential applications. For instance, approximated string values may be used to check the validity and security of generated strings, as well as to collect the useful string properties. Previous string analysis eāµorts have been focused primarily on the maxmization of the precision of regular approximations of strings. These methods have not been completely satisfactory due to the diculties in dealing with heap variables and context sensitivity. In this paper, we present an abstract-interpretation-based solution that employs a heuristic widening method. The presented solution is implemented and compared to JSA. In most cases, our solution gives results as precise as those produced by previous methods, and it makes the additional contribution of easily dealing with heap variables and context sensitivity in a very natural way. We anticipate the employment of our method in practical applications.