Menu
Forum
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Gallery
New media
New comments
Search media
Members
Registered members
Current visitors
Classifieds Member Feedback
SHOP
Shop Head Units
Shop Amplifiers
Shop Speakers
Shop Subwoofers
Shop eBay Car Audio
Log in / Register
Forum
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
Log in / Join
What’s new
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Menu
Reply to thread
Forum
Off-topic Discussion
The Lounge
More C++ Help needed ( overloading operators )
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="lilmaniac2" data-source="post: 4271077" data-attributes="member: 565395"><p>nothing to see here</p><p></p><p>[CODE]</p><p>/******************************************************************************/</p><p>/*********************************Chad Hicks***********************************/</p><p>/****************************** AU Unit Prog *********************************/</p><p>/**************************Written Using Dev-C++ Ver4**************************/</p><p>/*************************Written on March 6 2008 *************************/</p><p>/**************************For Math 271 Alan Smothers**************************/</p><p>/*****************************At Concord University****************************/</p><p>/******************************************************************************/</p><p></p><p></p><p></p><p></p><p>#include &lt;iostream&gt;</p><p>#include &lt;stdlib.h&gt;</p><p>#include &lt;stdio.h&gt;</p><p>#include &lt;time.h&gt;</p><p>#include &lt;math.h&gt;</p><p>#include &lt;fstream&gt;</p><p>#include &lt;string&gt;</p><p></p><p>using namespace std; //standard name functions</p><p></p><p></p><p>int main() //begin main</p><p>{</p><p>char c;</p><p>unsigned int memory[6000];</p><p>int x=0;</p><p>bool ioflag=0;</p><p> ifstream is;</p><p> is.open ("hw.txt"); // open file</p><p></p><p> unsigned int loc=0;</p><p> int count4=0;</p><p> int shift=4;</p><p> for (int ad=0; ad&lt;4000; ad++)</p><p> memory[ad]=0;</p><p></p><p> for (int b=0; b&lt;8; b++)</p><p> {</p><p> c = is.get(); // get character from file</p><p> x=c;</p><p> if (x&gt;=48 &amp;&amp; x&lt;=57)</p><p> {</p><p> x=x-48;</p><p> }</p><p> if (x&gt;=65 &amp;&amp; x&lt;=70)</p><p> {</p><p> x=x-55;</p><p> }</p><p> loc=loc+x;</p><p> cout&lt;&lt;loc&lt;&lt;endl;</p><p> loc=loc&lt;&lt;4;</p><p> }</p><p> cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;loc;</p><p> while (is.good()) // loop while extraction from file is possible</p><p> {</p><p> c = is.get(); // get character from file</p><p> x=c;</p><p> if (x&gt;=48 &amp;&amp; x&lt;=57)</p><p> {</p><p> x=x-48;</p><p> }</p><p> if (x&gt;=65 &amp;&amp; x&lt;=70)</p><p> {</p><p> x=x-55;</p><p> }</p><p> if (c=='\n')</p><p> x=-1;</p><p> if (x&gt;=0)</p><p> {</p><p> if (x&lt;8)</p><p> {</p><p> memory[loc]=memory[loc]&lt;&lt;1;</p><p> shift--;</p><p> }</p><p> if (x&lt;4)</p><p> {</p><p> memory[loc]=memory[loc]&lt;&lt;1;</p><p> shift--;</p><p> }</p><p> if (x&lt;2)</p><p> {</p><p> memory[loc]=memory[loc]&lt;&lt;1;</p><p> shift--;</p><p> }</p><p> memory[loc]=memory[loc]&lt;&lt;shift;</p><p> memory[loc]=x+memory[loc];</p><p> count4++;</p><p> shift=4;</p><p> if (count4&gt;=8)</p><p> {</p><p> loc++;</p><p> count4=0;</p><p> }</p><p> }</p><p> }</p><p></p><p> is.close(); // close file</p><p></p><p>if (count4==4)</p><p>memory[loc]=memory[loc]&lt;&lt;4;</p><p></p><p></p><p></p><p>system("PAUSE");</p><p>return 0; //end main</p><p>}</p><p></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="lilmaniac2, post: 4271077, member: 565395"] nothing to see here [CODE] /******************************************************************************/ /*********************************Chad Hicks***********************************/ /****************************** AU Unit Prog *********************************/ /**************************Written Using Dev-C++ Ver4**************************/ /*************************Written on March 6 2008 *************************/ /**************************For Math 271 Alan Smothers**************************/ /*****************************At Concord University****************************/ /******************************************************************************/ #include <iostream> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <math.h> #include <fstream> #include <string> using namespace std; //standard name functions int main() //begin main { char c; unsigned int memory[6000]; int x=0; bool ioflag=0; ifstream is; is.open ("hw.txt"); // open file unsigned int loc=0; int count4=0; int shift=4; for (int ad=0; ad<4000; ad++) memory[ad]=0; for (int b=0; b<8; b++) { c = is.get(); // get character from file x=c; if (x>=48 && x<=57) { x=x-48; } if (x>=65 && x<=70) { x=x-55; } loc=loc+x; cout<<loc<<endl; loc=loc<<4; } cout<<endl<<endl<<loc; while (is.good()) // loop while extraction from file is possible { c = is.get(); // get character from file x=c; if (x>=48 && x<=57) { x=x-48; } if (x>=65 && x<=70) { x=x-55; } if (c=='\n') x=-1; if (x>=0) { if (x<8) { memory[loc]=memory[loc]<<1; shift--; } if (x<4) { memory[loc]=memory[loc]<<1; shift--; } if (x<2) { memory[loc]=memory[loc]<<1; shift--; } memory[loc]=memory[loc]<<shift; memory[loc]=x+memory[loc]; count4++; shift=4; if (count4>=8) { loc++; count4=0; } } } is.close(); // close file if (count4==4) memory[loc]=memory[loc]<<4; system("PAUSE"); return 0; //end main } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forum
Off-topic Discussion
The Lounge
More C++ Help needed ( overloading operators )
Top
Menu
What's new
Forum list