need to aid on a program asap

i am asked to make a program that gets a text from the keyboard and prints out only the lines longer than x characters using pointers and vector (without strings) with the getline command but i cant seem to make its work as it prints out what i typed wtih no change . heres my code , pls give some help :


#include<iostream>
using namespace std;
int main()
{
char v[100];
char *vPtr=v;
int n=0;
int a;
cout<<"insert the number of characters per line you want "<<endl;
cin>>a;
int i=n;
cin.getline(v,100,EOF);

while(*vPtr!='\0' )
{
if(*vPtr=='\n')
{if(n>a)
{while(i>0)
{cout<<*(vPtr-i);
i--;
}
cout<<endl;
n=0;
}

else
n++;
vPtr++;
i=n; }

n++;
vPtr++;
i=n;

}

system ("pause");
return 0;
}
Topic archived. No new replies allowed.