wow
strrev(strcpy(chara2[i],chara1[i]));
actually works lol
Type: Posts; User: WaterSerpentM
wow
strrev(strcpy(chara2[i],chara1[i]));
actually works lol
its maybe easier to show you what im doing =]
the current output is:
0
01
012
0123
01234
012345
I'm not sure if its the right function to use, basically:
so, the function strcat() puts a char behind a string
is there a function that puts a char in front of a string
hey all again =]
I'm having problems with the putchar() function, here is the code:
putchar(chara1[i] + chara1[i-1]);
so, at the moment
int i;
int int1[10];
is that what that means?
change it to 10?
or 26?
the output of this code is scrambled, any help?
int i;
int int1[10];
char chara1[10][10];
char chara2[10][10];
hello all,
for my next calculation practice, I want to output sequence of arrays like this
0
01
012
0123
01234
012345
maybe you don't know, but most English words has other words like it with 's' in it that means the same thing. that's why there are so many 's' words in the dictionary =]
wonderful or...
is that google?
their definitions aren't exactly correct if you ask me
ye
i think they are the same word
lol
so, "looks more construct"
is basically, code which is more logical which takes less memory space and runs more efficiently, example:
instead of
printf("%d\n",inta1[0]);...
that was salem's coding originally,
and it looks more construct than yours
it works, it outputs:
aaaaaaaaaa
aaaaaaaaa
aaaaaaaa
aaaaaaa
aaaaaa
aaaaa
aaaa
aaa
check this out =]
#include <stdio.h>
#include <string.h>
int main() {
yup I get it entirely =]
so
array[0] starts off as nothing, then strcat to 'a'
then with strcpy, array[1] becomes 'a', then strcat to 'aa', and so on
?
i did run it
whats the point of printing before the loop?
btw the same thing happens without code 2
soz i edited just before you posted
'ok so,
on the first loop the first i is 0 and the second i is -1
?'
ok so,
on the first loop the first i is 0 and the second i is -2
?
im a bit confused, are they both 'ba' array? the 10 and 12 one?
thanks for the code, seeing that it works is one thing, i would like to know how one of the code means, can someone explain this code for me?
strcpy(ba[i],ba[i-1]);
char ba[10][12];
strcpy(ba[0],"a");
for(int i=0;i<10;i++) {
strcpy(ba[i],ba[i-1]);
strcat(ba[i],"a");
printf("%s\n",ba[i]);
}
=]
that outputs:
·⌂a
·⌂aa
·⌂aaa
·⌂aaaa
·⌂aaaaa
·⌂aaaaaa
·⌂aaaaaaa
·⌂aaaaaaaa