If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
after some years of pause, im returning to c.
char *varname = "asd";
int *number = 4;
the above code is wrong, because its assigning a value to an unreserved space, or because its changing the address the pointer is pointing ?
thanks for the replys!! (3 Replies)
1. The problem statement, all variables and given/known data:
So I have to write a Bourne script that will add two numbers, taking only two arguments and informs the user when it is used incorrectly.
2. Relevant commands, code, scripts, algorithms:
It has to be done in sh. I think overall,... (3 Replies)
#include <stdio.h>
int main(int argc, char *argv) {
printf("%d\n", sizeof(argv));
return 0;
}
when I run the executable a.out after compiling the above program as:
a.out short (or) a.out "long double", I expected to get the output as 2 and 12, but I am always getting the size of... (2 Replies)
Hello, this is probably a simple request but I've been toying with it for a while.
I have a large list of devices and commands that were run with a script, now I have lines such as:
a-router-hostname-C#show ver
I want to print everything up to (and excluding) the # and everything after it... (3 Replies)
Hi,
I am creating a program with the C language that simulates the WC command in Unix. My program needs to count lines, bytes and words. I have not added the code to count bytes and words yet. I am having trouble understanding what the file option/flag '-' does. I can not visualize how it moves... (1 Reply)
Hi All,
I am new to unix but have a requirement wherein I need to separate datatype,length, and column name from input file which is of below format --
record
integer(10) empid;
string(25) name;
date("YYYY-MM-DD") dob;
decimal(10) salary;
end
now after getting datatype,its length and... (4 Replies)
I have a sourcefile which contains data as below.I want to check whether datatype,structure and date format looks good as mentioned.
Data is delemited by cydila .
Source file-Emp.txt
sno name phoneno dept joineddate
1 vivek 0861 CSE 2013-05-29 00:00:00
2 dinesh 123456 ECE ... (2 Replies)
I have sourcefile and structure of source file,i want to check whether datatype and length mention in emp.txt is same as source file.
Example:
in emp.txt first row contains sno number so in source file also first column should contain only number if data is other than number then that... (1 Reply)
I have a sourcefile which contains data as below.I want to check whether datatype,structure and date format looks good as mentioned.
Data is delemited by cydila Ç.
Source file-Emp.txt
snoÇnameÇphonenoÇdeptÇjoineddate
1ÇvivekÇ0861ÇCSEÇ2013-05-29 00:00:00
2ÇdineshÇ123456ÇECEÇ2013-05-29 00:00:00... (8 Replies)
Discussion started by: katakamvivek
8 Replies
LEARN ABOUT DEBIAN
prophet::cli::texteditorcommand
Prophet::CLI::TextEditorCommand(3pm) User Contributed Perl Documentation Prophet::CLI::TextEditorCommand(3pm)
separator_pattern
A pattern that will match on lines that count as section separators in record templates. Separator string text is remembered as $1.
comment_pattern
A pattern that will match on lines that count as comments in record templates.
build_separator $text
Takes a string and returns it in separator form. A separator is a line of text that denotes a section in a template.
build_template_section header => '=== foo ===' [, data => 'bar']
Takes a header text string and (optionally) a data string and formats them into a template section.
try_to_edit template => $tmpl [, record => $record ]
Edits the given template if possible. Passes the updated template in to process_template (errors in the updated template must be handled
there, not here).
handle_template_errors error => 'foo', template_ref => $tmpl_str, bad_template => 'bar', rtype => 'ticket'
Should be called in "process_template" if errors (usually validation ones) occur while processing a record template. This method prompts
the user to re-edit and updates the template given by "template_ref" to contain the bad template (given by the arg "bad_template" prefixed
with the error messages given in the "error" arg. If an errors section already exists in the template, it is replaced with an errors
section containing the new errors.
If the template you are editing is not section-based, you can override what will be prepended to the template by passing in the
"errors_pattern" argument, and passing in "old_errors" if a template errors out repeatedly and there are old errors in the template that
need to be replaced.
Other arguments are: "rtype": the type of the record being edited. All arguments except overrides ("errors_pattern" and "old_errors" are
required.
calling code must implement
run process_template
perl v5.10.1 2009-08-17 Prophet::CLI::TextEditorCommand(3pm)