#include <iostream>
#include <fstream>
#include <string>

using namespace std;
    struct TsuPod //First letter capitalized just like in adobe reader file.
    {
        string title;
        string artist;
        int size;
    }

////////////////////////////////
/* FUNCTION - void initTsuPod

 Initialize all the slots to blank and 0 size memory. 
 
 input parms - none. 
 
 output parms - none
*/

void initTsuPod (int numSongs,TsuPod storedSongs[])
{ //Line 33
    for(int i = 0; i < numSongs; i++)
    {
        storedSongs[i].title = "Blank";
        storedSongs[i].artist = "Blank";
        storedSongs[i].size = 0;
    }
}

I have to do this project in a certain way for class and it incolves using and passing abstract data type arrays. When I try to compile I continue to get these two errors:

33 new types may not be defined in a return type

33 two or more data types in declaration of `initTsuPod'

After looking through this site the solution seems to be putting in a semi-colon somewhere but for the life of me I can’t figure out where one would have to go in order to make this work. Any help would be appreciated.

Recommended Answers

All 3 Replies

Try putting a semicolon after the } in the declaration of the TsuPod type

#include <iostream>
#include <fstream>
#include <string>

using namespace std;
    struct TsuPod //First letter capitalized just like in adobe reader file.
    {
        string title;
        string artist;
        int size;
    }  <----- semicolon

////////////////////////////////
/* FUNCTION - void initTsuPod

 Initialize all the slots to blank and 0 size memory. 
 
 input parms - none. 
 
 output parms - none
*/

void initTsuPod (int numSongs,TsuPod storedSongs[])
{ //Line 33
    for(int i = 0; i < numSongs; i++)
    {
        storedSongs[i].title = "Blank";
        storedSongs[i].artist = "Blank";
        storedSongs[i].size = 0;
    }
}

Try that to start

Doing this causes a host of other issues with the program once all the pieces are put together. However I think that just means the rest of my code is buggy so thank you guys for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.