Can you use double key input with the choice command in batch? [duplicate] - batch-file

This question already has answers here:
Batch file choice command more than 10 parameter
(1 answer)
batch file choice command when more than 10 number
(1 answer)
Closed yesterday.
I am currently programming activities in a simulation game, and wanted to ask if double key choices, such as 10, 11, 12, 13, 14 etc. would work some way.
I tried it, but it said ERROR: Double choices not allowed!.
I saw this is already a duplicate question, but the answer to the duplicate question, I do not understand.

Related

How to change a user password? [duplicate]

This question already has an answer here:
How to add, delete edit username from /etc/passwd [duplicate]
(1 answer)
Closed 6 years ago.
I m playing with /etc/passwd in my C program.
I want to change a user password. are there a standard linux functions that do a such functions ?
Method 1: system("passwd <parameters>");
Method 2: *pwent() function family and also putpwent().
The question is possibly a duplicate.
Linux stores the password in the /etc/shadow file. The second column (delimited by : character) in this file against the user name shows the hashed password.
It's best advised to not touch this file and cause harm. If you must, you can use the vipw utility for editing

How to edit stringd in a batch file [duplicate]

This question already has answers here:
Batch string replace
(3 answers)
Closed 6 years ago.
i'm new to batch programming but i cant find how to manipulate string in a specific manner like we would do in C++.
i want to create a batch file which would change.
00:1E:90:75:9F:9F
to
001E90759F9F
maybe you can try this:
sed 's/00:1E:90:75:9F:9F/001E90759F9F/' your_file_name

command line * linux [duplicate]

This question already has answers here:
Stop shell wildcard character expansion?
(4 answers)
Closed 6 years ago.
i'm trying to write code in C,which implements a simple calculator.
the input should come from the command line, so for example i if i run
./calculator 5 * 2
the result should be 10
the problem is that when i write * it shows all the files in the current directory and the program doesnt behave well.
there is anyway to overcome this problem?
i tried to find here or in other sites solutions,without success.
i need that * will Be interpreted as a char and not as a linux command.
thanks.
In linux shell, the * has special meaning. It is meant for globbing unless it is quoted like below
./calculator 5 '*' 2
You may also escape the asterisk to strip the special meaning from it
./calculator 5 \* 2

How can I read this file with space? [duplicate]

This question already has answers here:
How do you allow spaces to be entered using scanf?
(11 answers)
Closed 7 years ago.
1 0 Robin Fernandao
2 0 Christiano Gomez
3 1 Lionel Maradona
I have a file that has content like above and I'm trying to read in while loop fscanf(filename,"%d %d %s",array[i],array2[i],array3[i]); Everything ok without player name. It gives me name without last name.How can I fix it? is there any way to read like this file
Try this
fscanf(filename,"%d %d %[^\n]",array[i],array2[i],array3[i]);

How to delete the first line (not overwritten) of a file in C? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Delete a Line from a file in C Language
I know we could overwrite the first line, but here i need to total remove it.
For example, the file contains 100 lines, after i remove the first line, there are 99 lines left and the file size if reduced.
Note that the file is pretty large.
I don't know how to start this, is there any suggestion ? many thanks !
collect all the text of your file into a buffer and copy the same back into yoour file and whenever the required line appears, skip it.. This is all you can do..

Resources