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 8551431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:11:39+00:00 2026-06-11T14:11:39+00:00

I have a the following piece of code using ncurses. I would like to

  • 0

I have a the following piece of code using ncurses. I would like to know whether I can use a single move function to print a few lines.

For Example:

move(25,25);
printw("Line 1\n");
printw("Line 2\n");

Line 1 prints at (25,25) location but Line 2 prints at (26,0) if I don’t use move(26,25). Can I avoid the second move and still print Line 2 at (26,25)????

  • 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-06-11T14:11:40+00:00Added an answer on June 11, 2026 at 2:11 pm

    You can define a new window if what you want to print has to be aligned. Shortly :

    #include <ncurses.h>
    
    int main()
    {
      WINDOW* mywin;
    
      initscr();
      cbreak();
      keypad(stdscr, TRUE);
    
    
      int height=15;
      int width=30;
      int starty=25;
      int startx=25;
    
      printw("F9 to exit");
      refresh();
    
      mywin = newwin(height, width, starty, startx);
      mvwprintw(mywin,0,0,"First line\n");
      wprintw(mywin,"Second line");
      wrefresh(mywin);
    
      while(getch() != KEY_F(9)) {}
    
      endwin();
      return 0;
    }
    

    If this approach does not fit, then you’ll have to move manually to next position you want to print.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following piece of code which I'd like to optimize using Cython:
I'm using jQuery with rails and have the following piece of code $('#related').html(<%= render
I have the following piece of code in my Model: public function getSite() {
I have the following piece of code: function checkAmount() { var PayField = document.getElementById('paymentamount');
Say you have the following piece of code: function someProcess() { var deferred =
I have the following piece of code: if (SqlConnection.State == ConnectionState.Open) { using (SqlDataAdapter
I have defined the following piece of Coffeescript code below, which defines a function
I have the following piece of code that emits all my javascript: @using SquishIt.Framework.Minifiers.JavaScript
I have the following piece of code that checks whether port 443 is open
i have following piece of code with me iam spliting the words using only

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.