Toggle navigation
Toggle navigation
This project
Loading...
Sign in
안형준
/
Ds_worked
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
안형준
2018-11-20 22:36:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
59b50da6cc34ae17acac9ef25dd1a0f705ca61fb
59b50da6
1 parent
82247e85
error:모르겠다~~
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
Project/Application.cpp
Project/SortedLinkedList.h
Project/Application.cpp
View file @
59b50da
...
...
@@ -182,6 +182,16 @@ void Application::Delete()
MusicType
data
;
//Delete함수는 MusicType을 파라미터로 갖기 때문에 임의로 만들어준다.
data
.
SetNumFromKB
();
//사용자에게서 곡 번호를 입력받는다.
SearchByIndex
(
data
);
DoublyIter2
<
ManageType
>
Mgiter
(
mg_List
);
while
(
Mgiter
.
NotNull
())
{
if
(
Mgiter
.
GetCurrentNode
().
data
.
getIndex
()
==
data
.
GetNum
())
{
ManageType
*
mgptr
=
Mgiter
.
GetCurrentPtr
();
mgptr
->
Deleted
();
}
Mgiter
.
Next
();
}
/*DoublyIter<MusicType> Miter(m_List);
if (data.GetNum() < 1 || data.GetNum() > m_List.GetLength())
return;
...
...
@@ -195,16 +205,8 @@ void Application::Delete()
cout
<<
"
\t
삭제를 완료했습니다."
<<
endl
;
//삭제에 성공했으면 메시지를 출력한다.
RemakeSubList
();
//MusicList에 변화가 생겼으므로 하위 리스트들을 다시 만들어줘야 한다.
DoublyIter2
<
ManageType
>
Mgiter
(
mg_List
);
while
(
Mgiter
.
NotNull
())
{
if
(
Mgiter
.
GetCurrentNode
().
data
.
getIndex
()
==
data
.
GetNum
())
{
ManageType
*
mgptr
=
Mgiter
.
GetCurrentPtr
();
mgptr
->
Deleted
();
}
Mgiter
.
Next
();
}
if
(
m_List
.
GetLength
()
!=
0
)
//길이가 0이면 인덱스를 부여할수 없다.
{
SetMusicIndex
();
//MusicList에 변화가 생겼으므로 Index를 다시 부여한다.
...
...
Project/SortedLinkedList.h
View file @
59b50da
...
...
@@ -288,7 +288,7 @@ int SortedLinkedList<T>::Delete(T& data)
int
positionIndex
=
Get
(
data
);
if
(
positionIndex
)
{
for
(
int
i
=
1
;
i
<
positionIndex
;
i
++
)
for
(
int
i
=
1
;
i
<
=
positionIndex
;
i
++
)
pNode
=
pNode
->
next
;
if
(
pNode
->
next
!=
NULL
)
...
...
Please
register
or
login
to post a comment