The Mystery of Character

Posted: January 30, 2010 – 5:01 pm

by Robert Wilson
Author of The Hidden Assassins

The second most asked question of any writer after: Where do you get your ideas from? is: How do you think up your characters? The answer to the first question is that they just pop out of my diseased brain. The answer to the second is more complicated, but linked to the first.

I am a great observer of people, whether sitting in bars and cafés, or walking in the street, I am always looking at men, women and children and subconsciously making notes. I study not just what they’re wearing, but also what they’re trying to achieve. Are they being flashy or flirtatious, sober or sensible, casual or classy? I watch how they comport themselves. Are they hiding a pot belly, a bald head, a weak chin? How do others react to them? Do they turn heads? Are they an affront to other people? If someone particularly fascinates me I imagine the life they’ve lived or, more accurately, I give them a life to suit their look.

When it comes to writing I draw on these subconscious notes. They are rarely written down. The test is that if I have remembered them then they must have some importance. Quite often walk-on characters have assumed far greater roles in the story than I initially envisioned. A woman I may have seen in a cake shop and had concei
Navratri – Mystery of Goddess

ved of as nouveau riche, materialistic, conservative, firmly embedded in her social class and concerned about her position in it, can be transformed by fiction. She may suddenly refuse to behave in the way in which I imagined. Once I’ve put her in a scene, say, the grieving widow being interviewed by the detective investigating her husband’s murder, she may start to fight her way out of my fictional strait jacket. This is the wonder of being a writer; when characters assume life and take on an even greater reality.

Characters, like people, do not appear out of nowhere. First they have to belong somewhere. My first stop on the way to developing a character is to have the setting in mind. In my case I had decided that Seville in Spain would make a great setting for a crime novel. But why? Seville has one of the lowest murder rates in Spain, is recognized as one of the most beautiful cities in the world, with people who are amongst the most vivacious in Europe. And it was precisely for these reasons that I decided it would be the perfect setting for mayhem and murder.

One of the fundamental themes of crime fiction is: appearance and reality. What better place to set a crime novel than in a place which appears to be beautiful and full of attractive people, but which, like all cities, has a dark underbelly of crime, vice, drugs and racial tensions?

Even at this early stage there is a recognizable process. Characters are coming into being because I’m asking myself a series of questions. Their development, and that of the plot, will come from my answers to those questions. So because of the nature of my setting I decided that my detective hero was going to appear to be one sort of person, but in reality be someone completely different.

In The Blind Man of Seville when we first come across the Spanish detective, Chief Inspector Javier Falcón he is Mr. Straight. He is perfectly groomed in a suit which he wears buttoned up, a white shirt and tie and lace-up shoes. He is contained, some might say restrained. He is not liked by his colleagues, who find him cold and uncommunicative. They have given him the nickname of The Lizard. I began by creating a hero who was not instantly likeable. But what this gave me was the opportunity, in the course of the book, to change him.

Policemen are naturally conservative people, engaged in a profession with a hierarchy. In order to be a homicide detective you have to be a senior policeman and therefore middle-aged — and middle-aged men do not change. They might tell a new joke (if you’re lucky) or give up smoking or try out all the facial hair options, but they will not, fundamentally, change. So how could I change Javier Falcón? After some thought I realized that only a major psychological trauma was going to be able to wreak havoc (and therefore change) in the mind of such a person.

Our lives are built on the foundations of belonging. We have family who give us a sense of our place in the world. Rock those foundations and our world falls apart. This was what I did to Javier Falcón. In investigating a brutal murder in Seville he finds himself digging around in his own history. In doing so he uncovers some terrible truths about his own father and the way in which his beloved mother, who had died when he was only five years old, had met her end. They are shattering revelations. They break him as a human being and leave him hanging on to his new, terrible world by the thinnest of shreds.

This is another important part of character development — the back story. Where does your character come from? Where was he born? Where did he grow up? What is his relationship to his parents, siblings, friends, colleagues and lovers? Where did he go to school? Did he go to university? What was the political climate like? Why did he choose his current profession?

The answers to these questions can help you determine a character’s development, but what are the techniques that help you show these answers to your reader? Unless back story and the book’s plot are interwoven the reader does not want to know it. The reader is only interested in what’s happening now and what is going to happen.

There’s a limit to how much you can show through action and reaction — think how little you learn about people in everyday life from what they do and say, and I don’t just mean politicians. People have a habit of being deceptive, to protect themselves from intrusion. They are not usually open, especially if they have something terrible to hide.

Opening up characters is a tricky process but I have found one of the more fascinating ways is to put them into a scene with difficult people and in trying circumstances so that they give themselves away. Conflict leads to drama, which leads to revelations.

Another way of demonstrating a character is showing him from a different point of view: A sister may see her brother as lovable. A brother sees him as dependable. A colleague values the same man because of his insight. A lover despises him for some reason. And of course, all these ancillary characters have their own personalities and our understanding of them gives us a different perception of the hero.

But how do we get into the deeply hidden stuff? I chose to put Javier Falcón on the psychologist’s couch to reveal to him, and us, the bits that our hero doesn’t know himself.

The irony of all this is that in finally understanding Javier, we see him broken and we reach another unknowable area: What does he have inside him so that he can rebuild himself? I had the advantage of rehabilitating my hero in a series of books. In The Vanished Hands he mends himself through communication with others. The gross intrusion of reality into his own life has given him a better understanding of the intrusiveness of investigative police work into other peoples’ lives. It is for this reason that the plot and all the characters’ stories come out almost entirely in dialogue. In the latest novel, The Hidden Assassins, Javier is in full command of his new talents and has become more intuitive, instinctive and human.

Perhaps, though, the ultimate secret of character development, as with the eternal fascination of lovers, is that there must always be something unfathomable, an element of mystery.

Copyright © 2006 Robert Wilson

Author
Robert Wilson is the author of eight novels, including The Hidden Assassins (Published by Harcourt; November 2006;$25.00US; 0-15-101239-3) as well as A Small Death in Lisbon, which won the Gold Dagger Award as Best Crime Novel of the Year from Britain’s Crime Writers’ Association. He lives in Portugal and Oxford, England.

Robert Wilson

Technorati Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Strings in C-programming

Posted: January 26, 2010 – 6:00 pm

Lecture by Professor Jerry Cain for Programming Paradigms (CS107) in the Stanford University Computer Science department. In this lecture, Prof. Cain continues his lecture on the C programming language and generic stacks. Programming Paradigms (CS107) introduces several programming languages, including C, Assembly, C++, Concurrent Programming, Scheme, and Python. The class aims to teach students how to write code for each of these individual languages and to understand the programming …

A string is a sequence of characters. Any sequence or set of characters defined within double quotation symbols is a constant string. In c it is required to do some meaningful operations on strings they are:

  • Reading string displaying strings
  • Combining or concatenating strings
  • Copying one string to another.
  • Comparing string & checking whether they are equal
  • Extraction of a portion of a string

Strings are stored in memory as ASCII codes of characters that make up the string appended with ‘’(ASCII value of null). Normally each character is stored in one byte, successive characters are stored in successive bytes.

Initializing Strings

Following the discussion on characters arrays, the initialization of a string must the following form which is simpler to one dimension array.

char month1[ ]={‘j’,’a’,’n’,’u’,’a’,’r’,’y’};

Then the string month is initializing to January. This is perfectly valid but C offers a special way to initialize strings. The above string can be initialized char month1[]=”January”; The characters of the string are enclosed within a part of double quotes. The compiler takes care of string enclosed within a pair of a double quotes. The compiler takes care of storing the ASCII codes of characters of the string in the memory and also stores the null terminator in the end.

/*String.c string variable*/ 
#include < stdio.h > 
main() 

char month[15]; 
printf (“Enter the string”); 
gets (month); 
printf (“The string entered is %s”, month); 
}

In this example string is stored in the character variable month the string is displayed in the statement.

printf(“The string entered is %s”, month”);

It is one dimension array. Each character occupies a byte. A null character () that has the ASCII value 0 terminates the string. The figure shows the storage of string January in the memory recall that specifies a single character whose ASCII value is zero.

J

A

N

U

A

R

Y

Character string terminated by a null character ‘’. 

A string variable is any valid C variable name & is always declared as an array. The general form of declaration of a string variable is

Char string_name[size];

The size determines the number of characters in the string name.

Example:

char month[10]; 
char address[100];

The size of the array should be one byte more than the actual space occupied by the string since the complier appends a null character at the end of the string.

Reading Strings from the terminal:

The function scanf with %s format specification is needed to read the character string from the terminal.

Example:

char address[15]; 
scanf(“%s”,address); 

Scanf statement has a draw back it just terminates the statement as soon as it finds a blank space, suppose if we type the string new york then only the string new will be read and since there is a blank space after word “new” it will terminate the string.

Note that we can use the scanf without the ampersand symbol before the variable name. 
In many applications it is required to process text by reading an entire line of text from the terminal.

The function getchar can be used repeatedly to read a sequence of successive single characters and store it in the array.

We cannot manipulate strings since C does not provide any operators for string. For instance we cannot assign one string to another directly. 

For example:

String=”xyz”; 
String1=string2;

Are not valid. To copy the chars in one string to another string we may do so on a character to character basis.

Writing strings to screen:

The printf statement along with format specifier %s to print strings on to the screen. The format %s can be used to display an array of characters that is terminated by the null character for example printf(“%s”,name); can be used to display the entire contents of the array name.

Arithmetic operations on characters:

We can also manipulate the characters as we manipulate numbers in c language. When ever the system encounters the character data it is automatically converted into a integer value by the system. We can represent a character as a interface by using the following method.

X=’a’; 
Printf(“%dn”,x);

Will display 97 on the screen. Arithmetic operations can also be performed on characters for example x=’z’-1; is a valid statement. The ASCII value of ‘z’ is 122 the statement the therefore will assign 121 to variable x.

It is also possible to use character constants in relational expressions for example 
ch>’a’ && ch < = ’z’ will check whether the character stored in variable ch is a lower case letter. A character digit can also be converted into its equivalent integer value suppose un the expression a=character-‘1’; where a is defined as an integer variable & character contains value 8 then a= ASCII value of 8 ASCII value ‘1’=56-49=7.

We can also get the support of the c library function to converts a string of digits into their equivalent integer values the general format of the function in x=atoi(string) here x is an integer variable & string is a character array containing string of digits.

String operations (string.h)

C language recognizes that string is a different class of array by letting us input and output the array as a unit and are terminated by null character. C library supports a large number of string handling functions that can be used to array out many o f the string manipulations such as:

  • Length (number of characters in the string).
  • Concatentation (adding two are more strings)
  • Comparing two strings.
  • Substring (Extract substring from a given string)
  • Copy(copies one string over another)

To do all the operations described here it is essential to include string.h library header file in the program.

strlen() function:

This function counts and returns the number of characters in a string. The length does not include a null character.

Syntax n=strlen(string);

Where n is integer variable. Which receives the value of length of the string.

Example

length=strlen(“Hollywood”);

The function will assign number of characters 9 in the string to a integer variable length.

/*writr a c program to find the length of the string using strlen() function*/ 
#include < stdio.h > 
include < string.h > 
void main() 

char name[100]; 
int length; 
printf(“Enter the string”); 
gets(name); 
length=strlen(name); 
printf(“nNumber of characters in the string is=%d”,length); 
}

strcat() function:

when you combine two strings, you add the characters of one string to the end of other string. This process is called concatenation. The strcat() function joins 2 strings together. It takes the following form

strcat(string1,string2)

string1 & string2 are character arrays. When the function strcat is executed string2 is appended to string1. the string at string2 remains unchanged.

Example

strcpy(string1,”sri”); 
strcpy(string2,”Bhagavan”); 
Printf(“%s”,strcat(string1,string2);

From the above program segment the value of string1 becomes sribhagavan. The string at str2 remains unchanged as bhagawan.

strcmp function:

In c you cannot directly compare the value of 2 strings in a condition like if(string1==string2) 
Most libraries however contain the strcmp() function, which returns a zero if 2 strings are equal, or a non zero number if the strings are not the same. The syntax of strcmp() is given below:

Strcmp(string1,string2)

String1 & string2 may be string variables or string constants. String1, & string2 may be string variables or string constants some computers return a negative if the string1 is alphabetically less than the second and a positive number if the string is greater than the second.

Example:

strcmp(“Newyork”,”Newyork”) will return zero because 2 strings are equal. 
strcmp(“their”,”there”) will return a 9 which is the numeric difference between ASCII ‘i’ and ASCII ’r’. 
strcmp(“The”, “the”) will return 32 which is the numeric difference between ASCII “T” & ASCII “t”.

strcmpi() function

This function is same as strcmp() which compares 2 strings but not case sensitive.

Example

strcmpi(“THE”,”the”); will return 0.

strcpy() function:

C does not allow you to assign the characters to a string directly as in the statement name=”Robert”; 
Instead use the strcpy(0 function found in most compilers the syntax of the function is illustrated below.

strcpy(string1,string2);

Strcpy function assigns the contents of string2 to string1. string2 may be a character array variable or a string constant.

strcpy(Name,”Robert”);

In the above example Robert is assigned to the string called name.

strlwr () function:

This function converts all characters in a string from uppercase to lowercase.

syntax

strlwr(string);

For example:

strlwr(“EXFORSYS”) converts to exforsys.

rajatbhutani

Technorati Tags: , , , , , , , , , , , , , , , , , , , , , ,

Copyright © 2008 How to Draw Characters. All rights reserved.