int main(int argc, const char * argv[]) { int Sqlist[MAXSIZE]; int len; int i; printf("input array:(like 12,13,14):"); for (i = 0 ; i < 6 ; i++) { scanf("%d,",&Sqlist[i]); } len = 6; printf("\nThe spare length is : %d\n",MAXSIZE - len); insertElement(Sqlist, &len, 3, 88); for (i = 0 ; i < len ; i++) { printf("%d ",Sqlist[i]); } printf("\nThe spare length is : %d\n",MAXSIZE - len); insertElement(Sqlist, &len, 11, 0); DelElement(Sqlist, &len, 6); for (i = 0 ; i < len; i++) { printf("%d ",Sqlist[i]); } printf("\nThe spare length is %d\n",MAXSIZE - len); return 0; }
void DrawLab::delDot() { if( dots.getLen() ) { DelElement(dots,pick_ind); if( pick_ind>=dots.getLen() ) { if( pick_ind ) pick_ind--; } noNear(); redraw(); } }
QMenu* sTreeWidget::newMenu(xmlItem obj){ QMenu* menu = new QMenu; qDebug() << obj.nodeName(); if(obj.nodeName() == md_spravochniki){ QAction *act = new QAction("Новый справочник..",this); connect(act,SIGNAL(triggered()),this,SLOT(NewObjMd())); menu->addAction(act); } if(obj.nodeName() == md_documents){ QAction *act = new QAction("Новый документ..",this); connect(act,SIGNAL(triggered()),this,SLOT(NewObjMd())); menu->addAction(act); } if(obj.nodeName() == md_element){ QAction *act = new QAction("Добавить",this); connect(act,SIGNAL(triggered()),this,SLOT(NewElement())); menu->addAction(act); } if(obj.nodeName() == md_forms){ QAction *act = new QAction("Добавить",this); connect(act,SIGNAL(triggered()),this,SLOT(NewForm())); menu->addAction(act); } if(obj.nodeName() == md_field){ QAction *edit = new QAction("Редактировать",this); connect(edit,SIGNAL(triggered()),this,SLOT(EditElement())); menu->addAction(edit); QAction *del = new QAction("Удалить",this); connect(del,SIGNAL(triggered()),this,SLOT(DelElement())); menu->addAction(del); } return menu; }