Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:11:26+00:00 2026-05-31T23:11:26+00:00

It produces a garbled mess but also does print the correct information. It also

  • 0

It produces a garbled mess but also does print the correct information.
It also doesn’t seem to output all of the files. If I specify a smaller directory with less files all files are included, however when I do my entire Music directory, around 2000 files it only shows a menu with 3 items. I know it successfully scans the files, it seems to be a problem with my ncurses code.

void init_song_menu(vector<Song>& songs){
  int nsongs = (int) songs.size();
  printw("%d",nsongs);
  ITEM **items;
  items = (ITEM **)calloc(nsongs,sizeof(ITEM *));
  for(int i = 0; i < nsongs; ++i){
    //printw(choice.c_str());
    string* choice = new string;
    choices.push_back(choice);
  //*choice += songs.at(i).get_path();
   *choice += songs.at(i).get_ID3().title;
    items[i] = new_item(choice->c_str()," ");       
  }
  WINDOW *mw = newwin(30,90,4,4);
  LSTWINDOW* menu_win = (LSTWINDOW*) mw;
  menu_opts_off(menu_win->menu,O_SHOWDESC);
  menu_win->menu = new_menu((ITEM **)items);
  set_menu_win(menu_win->menu,mw);
  set_menu_sub(menu_win->menu,derwin(menu_win,26,88,3,1));
  set_menu_format(menu_win->menu,10,1);
  set_menu_mark(menu_win->menu,"*");
  wlist.push_back(menu_win);
  focused = menu_win;    
}

http://pastebin.com/jVQpLb6A

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:11:27+00:00Added an answer on May 31, 2026 at 11:11 pm

    The list of items must be NULL terminated. That is, you must allocate nsongs+1 and then set the last item to NULL:

    items[nsongs]=NULL;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code produces wrong and inconsistent output with gcc (4.1.2 20080704) but correct
The following code produces the output xyz a = %w{x y z} print a.to_s
This code produces a mess... What am I doing wrong? cell=$(<td>); if(normal.exam_type==Exam_Boolean) { var
This program produces the output I expect when given an input file of text
Pasting query into powerpivot produces the following error but works in CubeBrowser. : unable
I have application that produces files. I would like to connect those files with
My algorithm produces a list of (usually) several thousand line segments (all 2D) which
The code below produces this output fine: This is page one. This is page
This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer
Antlr3 produces the following output to System.out , while doing everything else correctly: line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.