<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Beginner C/C++ Forum RSS Feed (Replies Included)</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the 'Beginner C/C++' forum at Programmer's Heaven, including replies.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 11:00:28 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 11:00:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Re: A new way to start programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432116/432121/re-a-new-way-to-start-programming/#432121</link>
      <description>I'll try it&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432116/432121/re-a-new-way-to-start-programming/#432121</guid>
      <pubDate>Sat, 18 May 2013 22:59:07 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: A new way to start programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432116/432120/re-a-new-way-to-start-programming/#432120</link>
      <description>I'll try it&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432116/432120/re-a-new-way-to-start-programming/#432120</guid>
      <pubDate>Sat, 18 May 2013 22:57:15 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: A new way to start programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432116/432119/re-a-new-way-to-start-programming/#432119</link>
      <description>I'll try it&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432116/432119/re-a-new-way-to-start-programming/#432119</guid>
      <pubDate>Sat, 18 May 2013 22:55:25 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>A new way to start programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432116/432116/a-new-way-to-start-programming/</link>
      <description>Hey fellow programmers,&lt;br /&gt;
&lt;br /&gt;
I am trying to make a game that will teach the player about the basics of C++ programming. I just finished my first very early prototype and I would really love if you would try it and give me some feedback. I think it could be awesome with a game teaching programming so that more people might get interested in the beauty of programming. My goal is to make this to a full game and of course it will be free for everyone to use. &lt;br /&gt;
&lt;br /&gt;
In general I am interested in making the process in to programming much easier. This will probably result in a webpage with the game and a lot of informations&lt;br /&gt;
about how and what you need to start.&lt;br /&gt;
&lt;br /&gt;
I hope you will help me in the making of a new way to introduce programming for beginners.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance&lt;br /&gt;
&lt;br /&gt;
Jan :)&lt;br /&gt;
&lt;br /&gt;
Game can be found on www.sqdejan.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432116/432116/a-new-way-to-start-programming/</guid>
      <pubDate>Fri, 17 May 2013 16:32:33 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>A game about programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432080/432080/a-game-about-programming/</link>
      <description>Hey fellow programmers,&lt;br /&gt;
&lt;br /&gt;
I am trying to make a game that will teach the player about the basics of C++ programming. I just finished my first very early prototype and I would really love if you would try it and give me some feedback. I think it could be awesome with a game teaching programming so that more people might get interested in the beauty of programming. My goal is to make this to a full game and of course it will be free for everyone to use. &lt;br /&gt;
&lt;br /&gt;
In general I am interested in making the process in to programming much easier. This will probably result in a webpage with the game and a lot of informations&lt;br /&gt;
about how and what you need to start.&lt;br /&gt;
&lt;br /&gt;
I hope you will help me in the making of a new way to introduce programming for beginners.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance&lt;br /&gt;
&lt;br /&gt;
Jan :)&lt;br /&gt;
&lt;br /&gt;
The link for the game: &lt;a href="http://baboonlord.com/timtherobot/"&gt;http://baboonlord.com/timtherobot/&lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432080/432080/a-game-about-programming/</guid>
      <pubDate>Wed, 15 May 2013 03:52:03 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>A game about programming</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432079/432079/a-game-about-programming/</link>
      <description>Hey fellow programmers,&lt;br /&gt;
&lt;br /&gt;
I am trying to make a game that will teach the player about the basics of C++ programming. I just finished my first very early prototype and I would really love if you would try it and give me some feedback. I think it could be awesome with a game teaching programming so that more people might get interested in the beauty of programming. My goal is to make this to a full game and of course it will be free for everyone to use. &lt;br /&gt;
&lt;br /&gt;
In general I am interested in making the process in to programming much easier. This will probably result in a webpage with the game and a lot of informations&lt;br /&gt;
about how and what you need to start.&lt;br /&gt;
&lt;br /&gt;
I hope you will help me in the making of a new way to introduce programming for beginners.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance&lt;br /&gt;
&lt;br /&gt;
Jan :)&lt;br /&gt;
&lt;br /&gt;
The link for the game: &lt;a href="http://baboonlord.com/timtherobot/"&gt;http://baboonlord.com/timtherobot/&lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432079/432079/a-game-about-programming/</guid>
      <pubDate>Wed, 15 May 2013 03:50:12 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>C++ beginner, help for school project</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432014/432014/c++-beginner-help-for-school-project/</link>
      <description>Hello there! &lt;br /&gt;
&lt;br /&gt;
(I know that nobody want to make full new code for another people, but this is all about it, please continue reading)&lt;br /&gt;
&lt;br /&gt;
I am having trouble in school with some basic and easy (not for me) C++ programming.&lt;br /&gt;
If you could help me, I need codes for these programs to pass a high school grade. I study IT school, but I study multimedia and presentation, but they want basic programming too and I have no idea what to do with it.&lt;br /&gt;
&lt;br /&gt;
Thanks for any help guys!&lt;br /&gt;
&lt;br /&gt;
Create a program, which determines every prime number in interval &amp;lt;1;100&amp;gt; and then print to screen:&lt;br /&gt;
Prime numbers in range 1 – 100&lt;br /&gt;
number of prime numbers: NN&lt;br /&gt;
prime numbers: N N N N N N N N … N&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://prntscr.com/14dmw1"&gt;http://prntscr.com/14dmw1&lt;/a&gt; (this is printscreen for another project, by operator I mean + - * /)&lt;br /&gt;
&lt;br /&gt;
Create program, which declarates field formed by matrix named OKTO[8;8]. Matrix’s elements will be saved to file named OKTO_DATA, from element 1,1 to 8,8 where 1,1 to 1,8 is one entry.&lt;br /&gt;
For calculation value of elements you have to apply I+1 is double of I.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://wikisend.com/download/135354/moonlanding.jpg"&gt;http://wikisend.com/download/135354/moonlanding.jpg&lt;/a&gt; (link for image of flowchart)&lt;br /&gt;
&lt;br /&gt;
I beg anyone who can help me to help me, I know really nothing about programming, so I cant discuss this &lt;br /&gt;
any help will save my pass to another year of high school, I would be very very very thankfull if anyone helps.&lt;br /&gt;
PS: sorry for grammar or any english mistakes, it isnt my native language.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432014/432014/c++-beginner-help-for-school-project/</guid>
      <pubDate>Sat, 11 May 2013 02:55:41 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>C++ beginner, help for school project</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/432013/432013/c++-beginner-help-for-school-project/</link>
      <description>Hello there! &lt;br /&gt;
&lt;br /&gt;
(I know that nobody want to make full new code for another people, but this is all about it, please continue reading)&lt;br /&gt;
&lt;br /&gt;
I am having trouble in school with some basic and easy (not for me) C++ programming.&lt;br /&gt;
If you could help me, I need codes for these programs to pass a high school grade. I study IT school, but I study multimedia and presentation, but they want basic programming too and I have no idea what to do with it.&lt;br /&gt;
&lt;br /&gt;
Thanks for any help guys!&lt;br /&gt;
&lt;br /&gt;
Create a program, which determines every prime number in interval &amp;lt;1;100&amp;gt; and then print to screen:&lt;br /&gt;
Prime numbers in range 1 – 100&lt;br /&gt;
number of prime numbers: NN&lt;br /&gt;
prime numbers: N N N N N N N N … N&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://prntscr.com/14dmw1"&gt;http://prntscr.com/14dmw1&lt;/a&gt; (this is printscreen for another project, by operator I mean + - * /)&lt;br /&gt;
&lt;br /&gt;
Create program, which declarates field formed by matrix named OKTO[8;8]. Matrix’s elements will be saved to file named OKTO_DATA, from element 1,1 to 8,8 where 1,1 to 1,8 is one entry.&lt;br /&gt;
For calculation value of elements you have to apply I+1 is double of I.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://wikisend.com/download/135354/moonlanding.jpg"&gt;http://wikisend.com/download/135354/moonlanding.jpg&lt;/a&gt; (link for image of flowchart)&lt;br /&gt;
&lt;br /&gt;
I beg anyone who can help me to help me, I know really nothing about programming, so I cant discuss this &lt;br /&gt;
any help will save my pass to another year of high school, I would be very very very thankfull if anyone helps.&lt;br /&gt;
PS: sorry for grammar or any english mistakes, it isnt my native language.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/432013/432013/c++-beginner-help-for-school-project/</guid>
      <pubDate>Sat, 11 May 2013 02:53:50 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Card Shuffling Program.</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431916/431918/re-card-shuffling-program/#431918</link>
      <description>I may have just asked for the same thing twice...&lt;br /&gt;
Maybe all I'd need is for the program to roll eventually until it finally got one where none were replaced. And displayed the results.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431916/431918/re-card-shuffling-program/#431918</guid>
      <pubDate>Fri, 12 Apr 2013 23:40:56 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Card Shuffling Program.</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431917/431917/card-shuffling-program/</link>
      <description>I have no idea where to put this.&lt;br /&gt;
I was wondering how hard it would be to make a card shuffling program.&lt;br /&gt;
I want it to be truly randomized.&lt;br /&gt;
Here's a quick example for a 5 card deck:&lt;br /&gt;
&lt;br /&gt;
There are 5 slots so:&lt;br /&gt;
&lt;br /&gt;
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]&lt;br /&gt;
&lt;br /&gt;
and 5 cards:&lt;br /&gt;
&lt;br /&gt;
[ A ] [ B ] [ C ] [ D ] [ E ]&lt;br /&gt;
&lt;br /&gt;
and the true randomization im thinking about would go like this:&lt;br /&gt;
&lt;br /&gt;
A Random number between 1 and 5 is generated for card A, this will be it's slot. And so on for B,C,D and E.&lt;br /&gt;
&lt;br /&gt;
What common sense would say is that A gets a chance at 5 slots and B gets a chance at 4 slots and C,3 etc.&lt;br /&gt;
&lt;br /&gt;
But to me that's not true randomization.&lt;br /&gt;
&lt;br /&gt;
I want a program that shuffles it this way. A,B,C,D and E. Get the same chance at the same slot. It may end up like this:&lt;br /&gt;
&lt;br /&gt;
[ 1A ] [ 2E ] [ 3 ] [ 4D ] [ 5 ] - with B and C being replaced. And being left to the side so to speak with no slot. Because they were replaced.&lt;br /&gt;
&lt;br /&gt;
But this would be stage 1 of the shuffle. Next a number would have to be assigned to A,E and D. 1 for the number of times it successfully had a chance of entering the deck without being replaced.&lt;br /&gt;
&lt;br /&gt;
Next E,D,C,B and A would be rolled again in that order and it would say end up perfect like this, so to speak:&lt;br /&gt;
&lt;br /&gt;
[ 1D ] [ 2A ] [ 3C ] [ 4B ] [ 5E ]&lt;br /&gt;
&lt;br /&gt;
The program would then assign the number to the cards again. A-2 B-1 C-1 D-2 E-2.&lt;br /&gt;
&lt;br /&gt;
This is where the real randomization I want takes place. Since A,D and E have now entered the deck twice succesfully. The process has to be repeated until each card has finally had the exact same number of successful deck entries. Reversing "Roll" order each time. For up to a 150 card deck.&lt;br /&gt;
&lt;br /&gt;
How would one go about doing this and would it be difficult? If that would take too long to load I would understand. The number of times it would have to rinse and repeat would be astronomical.&lt;br /&gt;
&lt;br /&gt;
If that were the case then a simple "Each card gets an equal roll at a spot until finally it rolls each card into its own slot" would be fine.&lt;br /&gt;
&lt;br /&gt;
How would I go about doing 1 or the other? &lt;br /&gt;
And what are your opinions on this?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431917/431917/card-shuffling-program/</guid>
      <pubDate>Fri, 12 Apr 2013 23:27:19 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Card Shuffling Program.</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431916/431916/card-shuffling-program/</link>
      <description>I have no idea where to put this.&lt;br /&gt;
I was wondering how hard it would be to make a card shuffling program.&lt;br /&gt;
I want it to be truly randomized.&lt;br /&gt;
Here's a quick example for a 5 card deck:&lt;br /&gt;
&lt;br /&gt;
There are 5 slots so:&lt;br /&gt;
&lt;br /&gt;
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]&lt;br /&gt;
&lt;br /&gt;
and 5 cards:&lt;br /&gt;
&lt;br /&gt;
[ A ] [ B ] [ C ] [ D ] [ E ]&lt;br /&gt;
&lt;br /&gt;
and the true randomization im thinking about would go like this:&lt;br /&gt;
&lt;br /&gt;
A Random number between 1 and 5 is generated for card A, this will be it's slot. And so on for B,C,D and E.&lt;br /&gt;
&lt;br /&gt;
What common sense would say is that A gets a chance at 5 slots and B gets a chance at 4 slots and C,3 etc.&lt;br /&gt;
&lt;br /&gt;
But to me that's not true randomization.&lt;br /&gt;
&lt;br /&gt;
I want a program that shuffles it this way. A,B,C,D and E. Get the same chance at the same slot. It may end up like this:&lt;br /&gt;
&lt;br /&gt;
[ 1A ] [ 2E ] [ 3 ] [ 4D ] [ 5 ] - with B and C being replaced. And being left to the side so to speak with no slot. Because they were replaced.&lt;br /&gt;
&lt;br /&gt;
But this would be stage 1 of the shuffle. Next a number would have to be assigned to A,E and D. 1 for the number of times it successfully had a chance of entering the deck without being replaced.&lt;br /&gt;
&lt;br /&gt;
Next E,D,C,B and A would be rolled again in that order and it would say end up perfect like this, so to speak:&lt;br /&gt;
&lt;br /&gt;
[ 1D ] [ 2A ] [ 3C ] [ 4B ] [ 5E ]&lt;br /&gt;
&lt;br /&gt;
The program would then assign the number to the cards again. A-2 B-1 C-1 D-2 E-2.&lt;br /&gt;
&lt;br /&gt;
This is where the real randomization I want takes place. Since A,D and E have now entered the deck twice succesfully. The process has to be repeated until each card has finally had the exact same number of successful deck entries. Reversing "Roll" order each time.&lt;br /&gt;
&lt;br /&gt;
How would one go about doing this and would it be difficult? If that would take too long to load I would understand. The number of times it would have to rinse and repeat would be astronomical.&lt;br /&gt;
&lt;br /&gt;
If that were the case then a simple "Each card gets an equal roll at a spot until finally it rolls each card into its own slot" would be fine.&lt;br /&gt;
&lt;br /&gt;
How would I go about doing 1 or the other? &lt;br /&gt;
And what are your opinions on this?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431916/431916/card-shuffling-program/</guid>
      <pubDate>Fri, 12 Apr 2013 23:25:28 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>bitfields question</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431882/431882/bitfields-question/</link>
      <description>Could you please explane to me why the output of this code is 12 (1100b)&lt;br /&gt;
&lt;br /&gt;
and how the sizeof(bit1) is 4byte???&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
 void main()
{
struct bitfield
{
unsigned a:5;
unsigned c:5;
unsigned b:6;
 
};
char *p;
struct bitfield bit1={1,3,3};  //a=00001 ,c=00011 ,b=000011
p=&amp;amp;bit1;                           // p get the address of bit1
p++;                               // incriment the address of p in 1
 
printf("%d\n",*p); 
printf("%d\n",sizeof(bit1));             
 
}&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431882/431882/bitfields-question/</guid>
      <pubDate>Thu, 11 Apr 2013 11:44:50 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>bitfields question</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431881/431881/bitfields-question/</link>
      <description>Could you please explane to me why the output of this code is 12 (1100b)&lt;br /&gt;
&lt;br /&gt;
and how the sizeof(bit1) is 4byte???&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
 void main()
{
struct bitfield
{
unsigned a:5;
unsigned c:5;
unsigned b:6;
 
};
char *p;
struct bitfield bit1={1,3,3};  //a=00001 ,c=00011 ,b=000011
p=&amp;amp;bit1;                           // p get the address of bit1
p++;                               // incriment the address of p in 1
 
printf("%d\n",*p); 
printf("%d\n",sizeof(bit1));             
 
}&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431881/431881/bitfields-question/</guid>
      <pubDate>Thu, 11 Apr 2013 11:42:59 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Pointer Doubt and help with code</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431653/431846/re-pointer-doubt-and-help-with-code/#431846</link>
      <description>you should mention what you expecting from this code.&lt;br /&gt;
then it'easy to find what's going wrong.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431653/431846/re-pointer-doubt-and-help-with-code/#431846</guid>
      <pubDate>Mon, 08 Apr 2013 23:17:55 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Pointer Doubt and help with code</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431653/431845/re-pointer-doubt-and-help-with-code/#431845</link>
      <description>you should mention what you expecting from this code.&lt;br /&gt;
then it'easy to find what's going wrong.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431653/431845/re-pointer-doubt-and-help-with-code/#431845</guid>
      <pubDate>Mon, 08 Apr 2013 23:16:04 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Pointer Doubt and help with code</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431653/431844/re-pointer-doubt-and-help-with-code/#431844</link>
      <description>you should mention what you expecting from this code.&lt;br /&gt;
then it'easy to find what's going wrong.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431653/431844/re-pointer-doubt-and-help-with-code/#431844</guid>
      <pubDate>Mon, 08 Apr 2013 23:09:20 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Pointer Doubt and help with code</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431653/431843/re-pointer-doubt-and-help-with-code/#431843</link>
      <description>you should mention what you expecting from this code.&lt;br /&gt;
then it'easy to find what's going wrong.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431653/431843/re-pointer-doubt-and-help-with-code/#431843</guid>
      <pubDate>Mon, 08 Apr 2013 23:07:20 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Pointer Doubt and help with code</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431653/431842/re-pointer-doubt-and-help-with-code/#431842</link>
      <description>you should mention what you expecting from this code.&lt;br /&gt;
then it'easy to find what's going wrong.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431653/431842/re-pointer-doubt-and-help-with-code/#431842</guid>
      <pubDate>Mon, 08 Apr 2013 23:03:25 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: i have a error function should have a prototype</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431787/431807/re-i-have-a-error-function-should-have-a-prototype/#431807</link>
      <description>&lt;br /&gt;
the way your declaring your functions are not good.&lt;br /&gt;
&lt;br /&gt;
if your pushing into the stack then declare your prototype before your main method&lt;br /&gt;
void push(int p);&lt;br /&gt;
int pop(void);&lt;br /&gt;
&lt;br /&gt;
and for your pop you put a variable in the method declaration&lt;br /&gt;
int pop(int item);&lt;br /&gt;
you don't need to put a variable for any stack pop method&lt;br /&gt;
should be int pop(void);&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431787/431807/re-i-have-a-error-function-should-have-a-prototype/#431807</guid>
      <pubDate>Fri, 05 Apr 2013 09:35:08 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: i have a error function should have a prototype</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431787/431806/re-i-have-a-error-function-should-have-a-prototype/#431806</link>
      <description>&lt;br /&gt;
the way your declaring your functions are not good.&lt;br /&gt;
&lt;br /&gt;
if your pushing into the stack then declare your prototype before your main method&lt;br /&gt;
void push(int p);&lt;br /&gt;
int pop(void);&lt;br /&gt;
&lt;br /&gt;
and for your pop you put a variable in the method declaration&lt;br /&gt;
int pop(int item);&lt;br /&gt;
you don't need to put a variable for any stack pop method&lt;br /&gt;
should be int pop(void);&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431787/431806/re-i-have-a-error-function-should-have-a-prototype/#431806</guid>
      <pubDate>Fri, 05 Apr 2013 09:33:18 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: i have a error function should have a prototype</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431787/431805/re-i-have-a-error-function-should-have-a-prototype/#431805</link>
      <description>&lt;br /&gt;
the way your declaring your functions are not good.&lt;br /&gt;
&lt;br /&gt;
if your pushing into the stack then declare your prototype before your main method&lt;br /&gt;
void push(int p);&lt;br /&gt;
int pop(void);&lt;br /&gt;
&lt;br /&gt;
and for your pop you put a variable in the method declaration&lt;br /&gt;
int pop(int item);&lt;br /&gt;
you don't need to put a variable for any stack pop method&lt;br /&gt;
should be int pop(void);&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431787/431805/re-i-have-a-error-function-should-have-a-prototype/#431805</guid>
      <pubDate>Fri, 05 Apr 2013 09:31:28 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: i have a error function should have a prototype</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431787/431804/re-i-have-a-error-function-should-have-a-prototype/#431804</link>
      <description>: #include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
: #define MAX 100&lt;br /&gt;
: void push(int);&lt;br /&gt;
: int pop();&lt;br /&gt;
: int top=-1,f=0,i;&lt;br /&gt;
: int stack[MAX];&lt;br /&gt;
: void main()&lt;br /&gt;
: {&lt;br /&gt;
:   char post[100],x;&lt;br /&gt;
:   int value, a,b;&lt;br /&gt;
:     clrscr();&lt;br /&gt;
:   printf("Enter the Postfix Expression....");&lt;br /&gt;
:   gets(post);&lt;br /&gt;
:   for( i=0;(x=post[i])!='\0';i++)&lt;br /&gt;
:   {&lt;br /&gt;
:     if(isdigit(x))&lt;br /&gt;
:        {&lt;br /&gt;
: 	 push(x -'0');&lt;br /&gt;
:        }&lt;br /&gt;
:       else&lt;br /&gt;
:        {&lt;br /&gt;
: 	 a=pop();&lt;br /&gt;
: 	 b=pop();&lt;br /&gt;
: 	 value=perform(x,a,b);&lt;br /&gt;
: 	 push(value);&lt;br /&gt;
:        }&lt;br /&gt;
:     }&lt;br /&gt;
:    gets(post);&lt;br /&gt;
:   for(i=0;(x=post[i])!='\0';i++)&lt;br /&gt;
:   {&lt;br /&gt;
:     if(isdigit(x))&lt;br /&gt;
:     {&lt;br /&gt;
:       push(x=0);&lt;br /&gt;
:     }&lt;br /&gt;
:     else&lt;br /&gt;
:     {&lt;br /&gt;
:       a=pop();&lt;br /&gt;
:       b=pop();&lt;br /&gt;
:     value=perform(x,a,b);&lt;br /&gt;
:       push(value);&lt;br /&gt;
:     }&lt;br /&gt;
:   }&lt;br /&gt;
:   printf("The value of the postfix expression is :%d\n",stack[top]);&lt;br /&gt;
:   getch();&lt;br /&gt;
:   }&lt;br /&gt;
: &lt;br /&gt;
:   int perform(char y,int m, int n)&lt;br /&gt;
:   {&lt;br /&gt;
:    int k;&lt;br /&gt;
:    switch(y)&lt;br /&gt;
:    {&lt;br /&gt;
:      case '+':k=n+m;&lt;br /&gt;
: 	      break;&lt;br /&gt;
:       case '-':k=n-m;&lt;br /&gt;
: 	      break;&lt;br /&gt;
:       case '*':k=n*m;&lt;br /&gt;
: 	      break;&lt;br /&gt;
:        case '/':k=n/m;&lt;br /&gt;
: 	      break;&lt;br /&gt;
:        case '^':k=pow(n,m);&lt;br /&gt;
: 	       break;&lt;br /&gt;
:      }&lt;br /&gt;
:      return(k);&lt;br /&gt;
:    }&lt;br /&gt;
:   void push(int item)&lt;br /&gt;
:   {&lt;br /&gt;
:     if(top==MAX)&lt;br /&gt;
:     {&lt;br /&gt;
:       printf("overflow\n");&lt;br /&gt;
:       return;&lt;br /&gt;
:    }&lt;br /&gt;
:    else&lt;br /&gt;
:    {&lt;br /&gt;
:      top=top+1;&lt;br /&gt;
:      stack[top]=item;&lt;br /&gt;
:    }&lt;br /&gt;
:    return;&lt;br /&gt;
:   }&lt;br /&gt;
:   int pop(int item)&lt;br /&gt;
:   {&lt;br /&gt;
:    if(top==-1)&lt;br /&gt;
:    {&lt;br /&gt;
:     printf("underflow\n");&lt;br /&gt;
:     return;&lt;br /&gt;
:    }&lt;br /&gt;
:    else&lt;br /&gt;
:    {&lt;br /&gt;
:     item=stack[top];&lt;br /&gt;
: &lt;br /&gt;
: top=top-1;&lt;br /&gt;
:     return item;&lt;br /&gt;
:    }&lt;br /&gt;
:    }&lt;br /&gt;
: &lt;br /&gt;
the way your declaring your functions are not good.&lt;br /&gt;
&lt;br /&gt;
if your pushing into the stack then declare your prototype before your main method&lt;br /&gt;
void push(int p);&lt;br /&gt;
int pop(void);&lt;br /&gt;
&lt;br /&gt;
and for your pop you put a variable in the method declaration&lt;br /&gt;
int pop(int item);&lt;br /&gt;
you don't need to put a variable for any stack pop method&lt;br /&gt;
should be int pop(void);&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431787/431804/re-i-have-a-error-function-should-have-a-prototype/#431804</guid>
      <pubDate>Fri, 05 Apr 2013 09:28:58 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Help in C language please!!</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431649/431794/re-help-in-c-language-please/#431794</link>
      <description>Hi. &lt;br /&gt;
First of all, i would like you to know that if you are receiving strings in c console applications, it doesn't receive blank spaces (i use dev c++). But what you wish to do is possible. The steps you will need are;&lt;br /&gt;
&lt;br /&gt;
a. Receive string as input.&lt;br /&gt;
b. Convert the string to a character array.&lt;br /&gt;
c. Using a loop test if each array element is a space.&lt;br /&gt;
d. Use a variable to indicate when the array element is a space.            (a Boolean variable best suites this. It should be set to false if a space is not found and set to true if a space is found)&lt;br /&gt;
e. If the Boolean variable is true, then don't modify your output.&lt;br /&gt;
f. If the Boolean variable is false, then modify your output.&lt;br /&gt;
&lt;br /&gt;
I wrote the code below to show you what i mean;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
int myint = 0;   //integer variable used to indicate the presence of a space&lt;br /&gt;
int i = 0;       //integer variable used to move through the array&lt;br /&gt;
int count = 0;   // integer variable used for updating the output array&lt;br /&gt;
char mystring[12];  //Input string&lt;br /&gt;
char myoutput[12];  //Output String&lt;br /&gt;
&lt;br /&gt;
//Setting out input string to: qwe   t t  y   &lt;br /&gt;
//Notice it has 3 consecutive spaces, then one space then two consecutive spaces&lt;br /&gt;
mystring[0] = 'q';&lt;br /&gt;
mystring[1] = 'w';&lt;br /&gt;
mystring[2] = 'e';&lt;br /&gt;
mystring[3] = ' ';&lt;br /&gt;
mystring[4] = ' ';&lt;br /&gt;
mystring[5] = ' ';&lt;br /&gt;
mystring[6] = 't';&lt;br /&gt;
mystring[7] = ' ';&lt;br /&gt;
mystring[8] = 't';&lt;br /&gt;
mystring[9] = 't';&lt;br /&gt;
mystring[10] = ' ';&lt;br /&gt;
mystring[11] = 't';&lt;br /&gt;
&lt;br /&gt;
for ( i = 0; i &amp;lt;= 11; i++) &lt;br /&gt;
{&lt;br /&gt;
	if ( mystring[i] == ' ' ) // If the input string finds a blank space&lt;br /&gt;
		{&lt;br /&gt;
                     if (myint == 0)    //If our indicator variable if 0 meaning previous was not a blank space&lt;br /&gt;
                        {&lt;br /&gt;
                               myint = 1;    //Change indicator variable to 1 meaning a blank space found&lt;br /&gt;
                               myoutput[count] =  mystring[i]; //Update output&lt;br /&gt;
                               count ++ ;     // increase count to move to next space in output array&lt;br /&gt;
                        }&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
  else if (mystring[i] != ' ')        // if our input string doesn't find a blank space&lt;br /&gt;
        {&lt;br /&gt;
                myint = 0;       //Change indicator variable to 0 meaning a blank space not found&lt;br /&gt;
                myoutput[count] = mystring[i];  //Update output&lt;br /&gt;
                count ++;       // increase count to move to next space in output array&lt;br /&gt;
        }&lt;br /&gt;
                       }&lt;br /&gt;
   &lt;br /&gt;
   // Printing of input and  output to display the difference                   &lt;br /&gt;
  printf("Old String: ");&lt;br /&gt;
  printf("%s", mystring); &lt;br /&gt;
  printf("\n");&lt;br /&gt;
  printf("New String: ");                 &lt;br /&gt;
  printf("%s", myoutput);&lt;br /&gt;
  printf("\n");&lt;br /&gt;
  system("pause");&lt;br /&gt;
                       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431649/431794/re-help-in-c-language-please/#431794</guid>
      <pubDate>Fri, 05 Apr 2013 01:50:51 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Help in C language please!!</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431649/431793/re-help-in-c-language-please/#431793</link>
      <description>Hi. &lt;br /&gt;
First of all, i would like you to know that if you are receiving strings in c console applications, it doesn't receive blank spaces (i use dev c++). But what you wish to do is possible. The steps you will need are;&lt;br /&gt;
&lt;br /&gt;
a. Receive string as input.&lt;br /&gt;
b. Convert the string to a character array.&lt;br /&gt;
c. Using a loop test if each array element is a space.&lt;br /&gt;
d. Use a variable to indicate when the array element is a space.            (a Boolean variable best suites this. It should be set to false if a space is not found and set to true if a space is found)&lt;br /&gt;
e. If the Boolean variable is true, then don't modify your output.&lt;br /&gt;
f. If the Boolean variable is false, then modify your output.&lt;br /&gt;
&lt;br /&gt;
I wrote the code below to show you what i mean;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
int myint = 0;   //integer variable used to indicate the presence of a space&lt;br /&gt;
int i = 0;       //integer variable used to move through the array&lt;br /&gt;
int count = 0;   // integer variable used for updating the output array&lt;br /&gt;
char mystring[12];  //Input string&lt;br /&gt;
char myoutput[12];  //Output String&lt;br /&gt;
&lt;br /&gt;
//Setting out input string to: qwe   t t  y   &lt;br /&gt;
//Notice it has 3 consecutive spaces, then one space then two consecutive spaces&lt;br /&gt;
mystring[0] = 'q';&lt;br /&gt;
mystring[1] = 'w';&lt;br /&gt;
mystring[2] = 'e';&lt;br /&gt;
mystring[3] = ' ';&lt;br /&gt;
mystring[4] = ' ';&lt;br /&gt;
mystring[5] = ' ';&lt;br /&gt;
mystring[6] = 't';&lt;br /&gt;
mystring[7] = ' ';&lt;br /&gt;
mystring[8] = 't';&lt;br /&gt;
mystring[9] = 't';&lt;br /&gt;
mystring[10] = ' ';&lt;br /&gt;
mystring[11] = 't';&lt;br /&gt;
&lt;br /&gt;
for ( i = 0; i &amp;lt;= 11; i++) &lt;br /&gt;
{&lt;br /&gt;
	if ( mystring[i] == ' ' ) // If the input string finds a blank space&lt;br /&gt;
		{&lt;br /&gt;
                     if (myint == 0)    //If our indicator variable if 0 meaning previous was not a blank space&lt;br /&gt;
                        {&lt;br /&gt;
                               myint = 1;    //Change indicator variable to 1 meaning a blank space found&lt;br /&gt;
                               myoutput[count] =  mystring[i]; //Update output&lt;br /&gt;
                               count ++ ;     // increase count to move to next space in output array&lt;br /&gt;
                        }&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
  else if (mystring[i] != ' ')        // if our input string doesn't find a blank space&lt;br /&gt;
        {&lt;br /&gt;
                myint = 0;       //Change indicator variable to 0 meaning a blank space not found&lt;br /&gt;
                myoutput[count] = mystring[i];  //Update output&lt;br /&gt;
                count ++;       // increase count to move to next space in output array&lt;br /&gt;
        }&lt;br /&gt;
                       }&lt;br /&gt;
   &lt;br /&gt;
   // Printing of input and  output to display the difference                   &lt;br /&gt;
  printf("Old String: ");&lt;br /&gt;
  printf("%s", mystring); &lt;br /&gt;
  printf("\n");&lt;br /&gt;
  printf("New String: ");                 &lt;br /&gt;
  printf("%s", myoutput);&lt;br /&gt;
  printf("\n");&lt;br /&gt;
  system("pause");&lt;br /&gt;
                       }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431649/431793/re-help-in-c-language-please/#431793</guid>
      <pubDate>Fri, 05 Apr 2013 01:49:01 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>i have a error function should have a prototype</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/431787/431787/i-have-a-error-function-should-have-a-prototype/</link>
      <description>#include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
#define MAX 100&lt;br /&gt;
void push(int);&lt;br /&gt;
int pop();&lt;br /&gt;
int top=-1,f=0,i;&lt;br /&gt;
int stack[MAX];&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
  char post[100],x;&lt;br /&gt;
  int value, a,b;&lt;br /&gt;
    clrscr();&lt;br /&gt;
  printf("Enter the Postfix Expression....");&lt;br /&gt;
  gets(post);&lt;br /&gt;
  for( i=0;(x=post[i])!='\0';i++)&lt;br /&gt;
  {&lt;br /&gt;
    if(isdigit(x))&lt;br /&gt;
       {&lt;br /&gt;
	 push(x -'0');&lt;br /&gt;
       }&lt;br /&gt;
      else&lt;br /&gt;
       {&lt;br /&gt;
	 a=pop();&lt;br /&gt;
	 b=pop();&lt;br /&gt;
	 value=perform(x,a,b);&lt;br /&gt;
	 push(value);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
   gets(post);&lt;br /&gt;
  for(i=0;(x=post[i])!='\0';i++)&lt;br /&gt;
  {&lt;br /&gt;
    if(isdigit(x))&lt;br /&gt;
    {&lt;br /&gt;
      push(x=0);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
      a=pop();&lt;br /&gt;
      b=pop();&lt;br /&gt;
    value=perform(x,a,b);&lt;br /&gt;
      push(value);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  printf("The value of the postfix expression is :%d\n",stack[top]);&lt;br /&gt;
  getch();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  int perform(char y,int m, int n)&lt;br /&gt;
  {&lt;br /&gt;
   int k;&lt;br /&gt;
   switch(y)&lt;br /&gt;
   {&lt;br /&gt;
     case '+':k=n+m;&lt;br /&gt;
	      break;&lt;br /&gt;
      case '-':k=n-m;&lt;br /&gt;
	      break;&lt;br /&gt;
      case '*':k=n*m;&lt;br /&gt;
	      break;&lt;br /&gt;
       case '/':k=n/m;&lt;br /&gt;
	      break;&lt;br /&gt;
       case '^':k=pow(n,m);&lt;br /&gt;
	       break;&lt;br /&gt;
     }&lt;br /&gt;
     return(k);&lt;br /&gt;
   }&lt;br /&gt;
  void push(int item)&lt;br /&gt;
  {&lt;br /&gt;
    if(top==MAX)&lt;br /&gt;
    {&lt;br /&gt;
      printf("overflow\n");&lt;br /&gt;
      return;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     top=top+1;&lt;br /&gt;
     stack[top]=item;&lt;br /&gt;
   }&lt;br /&gt;
   return;&lt;br /&gt;
  }&lt;br /&gt;
  int pop(int item)&lt;br /&gt;
  {&lt;br /&gt;
   if(top==-1)&lt;br /&gt;
   {&lt;br /&gt;
    printf("underflow\n");&lt;br /&gt;
    return;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
    item=stack[top];&lt;br /&gt;
&lt;br /&gt;
top=top-1;&lt;br /&gt;
    return item;&lt;br /&gt;
   }&lt;br /&gt;
   }&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/431787/431787/i-have-a-error-function-should-have-a-prototype/</guid>
      <pubDate>Thu, 04 Apr 2013 20:54:07 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>