what is the problem ? help !

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>

using namespace std;

char text[]={"Hi friends, good morning."};
char temp;
int i;
int j;

int main()
{
    for(i=0;i<sizeof(texto)/3;i+=1)
    {
        temp=text[3i];
        text[3i]=text[3i+1];
        text[3i+1]=text[3i+2]
        text[3i+2]=temp;
        
        cout << text[3i+1] << text[3i+2] << text [3i];
        }
    if(sizeof(text)%3!=0)
    {
    for(int j=0; j<sizeof(text)%3;j++)
    {
            cout << text[3i+j];
    }
    }   
    
    system("PAUSE");
    return EXIT_SUCCESS;
}


anyone tell me what my mistake ...
for(i=0;i<sizeof(texto)/3;i+=1) What is texto?
is text , i'm portuguese , have traducing to english and miss that word .
dioing,
Moschops is asking you what is "texto"? should that be "text" ?

Also, you cant put "3i" and expect to get "3*i" if that is what you are trying to use. the compiler wont understand what 3i is.
its not a valid variable name.
That's right, LGonzalez.
I forgot c++ don't read this , we have explain everything !
Thank you !
Topic archived. No new replies allowed.