Up through ex8
This commit is contained in:
parent
7da7228911
commit
af95125894
1
lcthw/.gitignore
vendored
1
lcthw/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
ex1
|
||||
ex3
|
||||
ex7
|
||||
ex8
|
||||
|
@ -1,6 +1,6 @@
|
||||
CFLAGS ?= -Wall -g
|
||||
GDBRUN = gdb --batch --ex run --ex bt --ex q --args
|
||||
BUILD_TARGETS = ex1 ex3 ex7
|
||||
BUILD_TARGETS = ex1 ex3 ex7 ex8
|
||||
|
||||
.PHONY: all
|
||||
all: build test
|
||||
@ -14,10 +14,10 @@ build: $(BUILD_TARGETS)
|
||||
|
||||
.PHONY: gtest
|
||||
gtest:
|
||||
$(foreach bt,$(BUILD_TARGETS),$(GDBRUN) ./$(bt) &&) \
|
||||
echo gyay
|
||||
@$(foreach bt,$(BUILD_TARGETS),$(GDBRUN) ./$(bt) &&) \
|
||||
echo ' gYAY'
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(foreach bt,$(BUILD_TARGETS),./$(bt) &&) \
|
||||
echo yay
|
||||
@$(foreach bt,$(BUILD_TARGETS),./$(bt) &&) \
|
||||
echo ' YAY'
|
||||
|
21
lcthw/ex8.c
Normal file
21
lcthw/ex8.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (argc == 1) {
|
||||
printf("You no argument.\n");
|
||||
} else if (argc > 1 && argc < 4) {
|
||||
printf("Here's your arguments:\n");
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
printf("%s ", argv[i]);
|
||||
}
|
||||
printf("\n");
|
||||
} else {
|
||||
printf("You have too many arguments.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user