I want to be able to read 2 line input, then safe them in separate arrays.
soo;
line1 input=array1
line2=array2
Thank youu
I want to be able to read 2 line input, then safe them in separate arrays.
soo;
line1 input=array1
line2=array2
Thank youu
See strcpy or memcpy functions.
strcpy - C++ Reference
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
Call "fgets()" twice.
I dont really understand, if i have this at the standard input
12345
67890
how would i get the program to read that? :s
Are you expecting numbers or strings?
Do you know how to read input and store it in a variable?
its eventually going to be for a poker hand evaluator. a,k,q,j,0,9,8,7,6,5,4,3,2 and d,s,h,c
You can either read in each line character-by-character, or you can read each line as a complete string. In either case, each line can be stored in its own array.
Here's a link to the tutorial on strings from this site:
C Strings - Cprogramming.com
Note the usage of "fgets()" to read a string from a line.
Start small - write a program to read a string or two and print them out to the screen. When that is working well, and you're more comfortable with strings, add some more code to analyze the strings for content.
You're going to need to post some code first. Then ask some specific question about the code posted. Here's a link to a relevant post and response; look at the response from Whiteflags when you click the link.
please help