I have to make a pyramid only using C, no C++. what I have to do is this, I have a string "this is a string " (yes the space is suppose to be there), and I have to "remove" one letter from both sides, and print that. like this
"this is a string "
"his is a string"
"is a strin"
"s a stri"
" a str"
This is repeated until there are no more characters. My teacher says to use substrings, is there any thing in C that says
print from location (index 0 to index x)
print from location (index 1 to index x-1)
I know I have to use a for
loop.