no coge valor la variable
Publicado por Laura (44 intervenciones) el 13/04/2006 18:31:55
tengo este codigo q va correcto: me coge los valores perfectos, pido al usuario y los guarda bien y el reescribir de nuevo si no he cambiado etan los antiguos y si no los nuevos. Pero con marquee no me coge los antiguos.
void marquee::pedir_marquee (string a, int b)
{
string velo;
string com;
switch (b)
{
case 1:{
cout <<"introduce "<<a <<" nueva"<<endl;
cin>>velo;
velocidad=velo;
}
break;
case 2: {
cout <<"introduce "<<a<<" nueva"<<endl;
cin>>com;
movimiento=com;
}
break;
}
}
void marquee::reescribir_marquee (string line_aux)
{
const int SIZE =2000;
char *line =new char [SIZE];
string a="<MARQUEE SCROLLAMOUNT=\"4\" SCROLLDELAY=\"";
a.append(velocidad);
cout << a << endl;
a.append("\" BEHAVIOR=\"");
cout << a << endl;
a.append(movimiento);
cout << a << endl;
fflush(stdin);
cin.get();
}
Pido los nuevos valores y luego si lo he modificado bien, sino me lo muestra vacio. ¿Poruqe es si recoge correcto la variable?
void marquee::pedir_marquee (string a, int b)
{
string velo;
string com;
switch (b)
{
case 1:{
cout <<"introduce "<<a <<" nueva"<<endl;
cin>>velo;
velocidad=velo;
}
break;
case 2: {
cout <<"introduce "<<a<<" nueva"<<endl;
cin>>com;
movimiento=com;
}
break;
}
}
void marquee::reescribir_marquee (string line_aux)
{
const int SIZE =2000;
char *line =new char [SIZE];
string a="<MARQUEE SCROLLAMOUNT=\"4\" SCROLLDELAY=\"";
a.append(velocidad);
cout << a << endl;
a.append("\" BEHAVIOR=\"");
cout << a << endl;
a.append(movimiento);
cout << a << endl;
fflush(stdin);
cin.get();
}
void marquee::pedir_marquee (string a, int b)
{
string velo;
string com;
switch (b)
{
case 1:{
cout <<"introduce "<<a <<" nueva"<<endl;
cin>>velo;
velocidad=velo;
}
break;
case 2: {
cout <<"introduce "<<a<<" nueva"<<endl;
cin>>com;
movimiento=com;
}
break;
}
}
void marquee::reescribir_marquee (string line_aux)
{
const int SIZE =2000;
char *line =new char [SIZE];
string a="<MARQUEE SCROLLAMOUNT=\"4\" SCROLLDELAY=\"";
a.append(velocidad);
cout << a << endl;
a.append("\" BEHAVIOR=\"");
cout << a << endl;
a.append(movimiento);
cout << a << endl;
fflush(stdin);
cin.get();
}
Pido los nuevos valores y luego si lo he modificado bien, sino me lo muestra vacio. ¿Poruqe es si recoge correcto la variable?
void marquee::pedir_marquee (string a, int b)
{
string velo;
string com;
switch (b)
{
case 1:{
cout <<"introduce "<<a <<" nueva"<<endl;
cin>>velo;
velocidad=velo;
}
break;
case 2: {
cout <<"introduce "<<a<<" nueva"<<endl;
cin>>com;
movimiento=com;
}
break;
}
}
void marquee::reescribir_marquee (string line_aux)
{
const int SIZE =2000;
char *line =new char [SIZE];
string a="<MARQUEE SCROLLAMOUNT=\"4\" SCROLLDELAY=\"";
a.append(velocidad);
cout << a << endl;
a.append("\" BEHAVIOR=\"");
cout << a << endl;
a.append(movimiento);
cout << a << endl;
fflush(stdin);
cin.get();
}
Valora esta pregunta


0