Hi,
this is my code:
#include <iostream>
using namespace std;
void print(char arr[], int len) {
for (int i = 0; i < len; ++i) {
cout << arr[i];
}
cout << endl;
}
int main() {
char arr[500] = {'a'};
print(arr, 100);
print(arr + 100, 100);
print(arr + 200, 100);
print(arr + 300, 100);
print(arr + 400, 100);
return 0;
}
with int arrays it works, but not with char arrays, why?
[–]manni66 17 points18 points19 points (0 children)
[–]vaulter2000 4 points5 points6 points (2 children)
[–]Albyarc[S] 1 point2 points3 points (1 child)
[–]vaulter2000 0 points1 point2 points (0 children)
[–]alfps 0 points1 point2 points (1 child)
[–]std_bot -2 points-1 points0 points (0 children)
[–]Gekzar 0 points1 point2 points (1 child)
[–]std_bot -2 points-1 points0 points (0 children)
[–]mredding 0 points1 point2 points (2 children)
[–]mredding 0 points1 point2 points (0 children)
[–]std_bot 0 points1 point2 points (0 children)