Solved

strings in arrays

Posted on 2000-03-15
3
172 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compile VxWorks Toronado project under Visual Studio 11 223
mixing C++ and C code elegantly 10 158
Adjust Mfcapp 29 172
Loading flat file data in tables 2 41
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

829 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