Solved

strings in arrays

Posted on 2000-03-15
3
171 Views
Last Modified: 2011-09-20
I have an string being sent to a program called trx_str then into that string at positions 15-18 I need to copy the last 4 numbers from another array called seq_number.

Could you help please

TIA

Craig
0
Comment
Question by:csindorf
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 50 total points
ID: 2620090
Hi,here it is:

int len=strlen(seq_number)-4;
for(int i=0;i<4;i++)
trx_str[i+15]=seq_number[i+len];


Free to ask ...

Regards
W.Yinan
0
 

Author Comment

by:csindorf
ID: 2640661
Thanks
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2640881
You are welcome:)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
negation in C function 14 153
Want to delete all my personal data 13 145
UPD maximums on Red Hat 6 114
A  &&  B  || (C||D) how it works in c 7 53
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question