Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help Regarding String in C

Status
Not open for further replies.

thecall

Junior Member level 2
Joined
Mar 4, 2007
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,448
hi

i am trying to work in C and while working with strings i got some probs actually i was solving end probs of yashvant kanetkar book LET US C.

these are the probs:

how to extract some part of the string ?
i know one thing about this like if we have string

char n[40]="i m beginner"
then if we write
printf("%s",&n[4]);

it will print beginner staring from 5th postition.
but if i want just to print "beg " then how i can give endpoint. like it goes to g and terminates how to give terminating point.


------------------------

What are strings and int......... i need to convert string to int....

how its possible
dont give Code just guide me

thnx in adv.
 

Your compiler will have a standard string library with a header file called <string.h>
If you open it you will see the function prototypes of the standard string library.
Use these functions to manipulate your strings.
 

it should print "beginner". The string stops normally at the first encountered 0 byte (I mean zerozero, not the character '0').

What compiler do you use, on what platform?
 

i am using turbo C and WIN XP

plz help wit how to tell prog to stop at the desired char like i just want to print king how it will terminate after 'g'
 

%3s would print up to 3 characters of a strinc only. More complex string manipulations can be achieved with string functions. You should read about printf() format specifiers and string functions.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top