The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Local variables - C Style
11-07-2015, 09:08 AM (This post was last modified: 11-07-2015 12:47 PM by alen12345.)
Post: #1
Local variables - C Style
Dear users,

I have not fully understood the scope of local variables on my HP50G. I would like to create programs on the fly which store intermediate result in order to display them just before the end of the program. Something stupid like this one in C++:

Code:

#include <iostream>
using namespace std;
int main()
{
//Dati
    int a=2; int b=3;
//Risoluzione
    int c=a+b;
    int d=c*c;
    int f=c*c*c+d;
    cout<<"Risultato: "<<f<<endl;
    return 0;
}

Something that would not involve stack manipulation which would become rather difficult in longer programs.

Thanks in advance for your help.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Local variables - C Style - alen12345 - 11-07-2015 09:08 AM
RE: Local variables - C Style - Han - 11-07-2015, 12:28 PM
RE: Local variables - C Style - alen12345 - 11-07-2015, 12:48 PM
RE: Local variables - C Style - peacecalc - 11-07-2015, 01:41 PM
RE: Local variables - C Style - C.Ret - 11-08-2015, 02:52 PM
RE: Local variables - C Style - peacecalc - 11-08-2015, 07:28 PM



User(s) browsing this thread: 1 Guest(s)