LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2014, 10:35 AM   #1
errigour
Member
 
Registered: May 2009
Posts: 366

Rep: Reputation: 6
Space mvwprintw %d


Alright this code is exactly like it appears in the program, is there any
reason why move_count displays an integer on the second line it appears but
the first line is always 0?

Code:
mvwprintw(navigation, 0, 0, "%s %d$b move_count: %d", p.name, p.brail, move_count);
mvwprintw(navigation, 1, 1, "Plate: %d/%d", p.ship->max_plate, p.ship->plate);
mvwprintw(navigation, 2, 1, "Shield: %d/%d", p.ship->max_shield, p.ship->shield);
mvwprintw(navigation, 3, 1, "Dodge: %d", p.ship->dodge);

mvwprintw(navigation, 5, 1, "Primary Weapon: %s", weapon_s[p.ship->p_weapon]);
mvwprintw(navigation, 6, 1, "Targetting: %d", weapon[p.ship->p_weapon].targeting);
mvwprintw(navigation, 7, 1, "Range: %d", weapon[p.ship->p_weapon].range);
mvwprintw(navigation, 8, 1, "Weapon Strength: %d", weapon[p.ship->p_weapon].w_str);

mvwprintw(navigation, 10, 1, "Secondary Weapon: %s", weapon_s[p.ship->s_weapon]);
mvwprintw(navigation, 11, 1, "Targetting: %d", weapon[p.ship->s_weapon].targeting);
mvwprintw(navigation, 12, 1, "Range: %d", weapon[p.ship->p_weapon].range);
mvwprintw(navigation, 13, 1, "Weapon Strength: %d", weapon[p.ship->s_weapon].w_str);

mvwprintw(navigation, 15, 1, "move_count: %d", move_count);
mvwprintw(navigation, 16, 1, "spawn_count: %d", spawn_count);

Last edited by errigour; 10-23-2014 at 10:42 AM.
 
Old 10-25-2014, 07:45 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Methinks you should debug your program... that's what gdb is good for.
 
Old 10-25-2014, 09:31 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Since this sounds like memory corruption, valgrind may also be useful.
 
Old 10-25-2014, 04:14 PM   #4
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
Bah I hate debugging problems with valgrind, the game runs so very slow.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
Unable to read the updated buffer in kernel space from user space raju_1234 Linux - Embedded & Single-board computer 0 06-20-2012 01:50 AM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
how to call socket prog code written in user space from kernel space???HELP kurt2 Programming 2 07-15-2009 09:56 PM
LXer: Worms in space: NASA confirms International Space Station infected LXer Syndicated Linux News 0 08-28-2008 09:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration