mirror of
https://github.com/RolandWH/ceesort.git
synced 2025-03-14 17:01:36 +00:00
check that argument(s) were provided at launch
This commit is contained in:
parent
470d60f300
commit
db2bfd4ee0
@ -21,6 +21,12 @@ bool isint(char* s)
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
puts("ERROR: Must have at least one argument (number)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int* arr = malloc((argc - 1) * sizeof(int));
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user