GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 403 of 453    Print  
String Storing
how we can store more than 128chars in char-variable.


  
Total Answers and Comments: 2 Last Update: May 20, 2008     Asked by: ysnkumar 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: spremkumar
 
Make char as unsinged char.

Above answer was rated as good by the following members:
tigersasi, RoMBiN
February 06, 2008 09:48:09   #1  
spremkumar Member Since: February 2008   Contribution: 1    

RE: String Storing
Make char as unsinged char.
 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
May 20, 2008 03:15:25   #2  
aman15490 Member Since: May 2008   Contribution: 70    

RE: String Storing
simply by making it as unsigned char so the the last bit which is sign bit will be used to store a number now thus range becomes 0-255.
 
Is this answer useful? Yes | No

 Related Questions

The register modifier hints to the compiler that the variable will be heavily used and should be kept in the CPU’s registers, if possible, so that it can be accessed faster. There are several restrictions 
Latest Answer : If a variable is defined by using register modifier it tells to the compiler that the variable is used repetedly and that variable executes fastly. Generally register variables are defined in loop counters. This variable stored in CPU registers and access ...

A type-insensitive macro is a macro that performs the same basic operation on different data types. This task can be accomplished by using the concatenation operator to create a call to a type-sensitive 

What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
The strcpy() function is designed to work exclusively with strings. It copies each byte of the source string to the destination string and stops when the terminating null character () has been moved. 

The standard C library provides several functions for converting numbers of all formats (integers, longs, floats, and so on) to strings and vice versa  The following functions can be used to convert 
Latest Answer : sprintf() is used to convert integer to string. ...

The standard C library provides several functions for converting strings to numbers of all formats (integers, longs, floats, and so on) and vice versa.  The following functions can be used to convert 
Latest Answer : /*Let take an example*/main(){char rasmi="111";int ranjan;ranjan=atoi(rasmi);printf("n This is Rasmi Ranjan Nayak's Reply %d n", ranjan);} ...

/* Use printf() to print the first 11 characters of source_str. */ printf(“First 11 characters: ‘%11.11s’n”, source_str);  
Latest Answer : You can also print it using pointers....Try this following code segment ... This does the trick. char str[]="The Sky is Blue and so are you";char *s1= &str[5];printf("%sn",s1); ...

A void pointer is a C convention for “a raw address.” The compiler has no idea what type of object a void Pointer “really points to.” If you write int *ip; ip points to an int. 
Latest Answer : Void Pointer or Generic Pointer is the one to which any datatype can be assigned.eg.main(){    int *p;     void *vp;     vp=p;} ...
Tags : Pointer

The hardest part about using a pointer-to-function is declaring it.  Consider an example. You want to create a pointer, pf, that points to the strcmp() function. The strcmp() function is declared 
Tags : Pointer

An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length. There are two kinds of programming languages: those in which a string is 
Latest Answer : An array is collection of simillar(any data type like char, int, float ..etc) , string is an array is characters. ...

Whenever an array name appears in an expression such asØ      array as an operand of the sizeof operatorØ      array as an operand of & 


 Sponsored Links

 
Related Articles

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement #include <stdl
 

String handling functions

What is the string handling functions present in header file <string.h>? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include <string.h&am
 

Convert a String into Long Value

What string function is used to convert a string into long value? This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
 

Base Address of the String

What happens when we try to change the value of base address of the string? The base address of the sting takes a special place in the context of strings. This is because suing this base address only the string gets identified. In other words the base address therefore takes the position of constant
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape