|
Instead of accessing the document's member variables directly, you'd be wise to use a "getter" method instead. For example, if the document contained information about a person, it should have method for retrieving that information something like:
class CMyDocument : public CDocument
{
private:
CString m_strName;
CString m_strAddress;
UINT m_uAge;
public:
CString GetName() const;
CString GetAddress() const;
UINT GetAge() const;
};
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
hi~everyone
i hava a question puzzle me ! when i used "CFile's" open()function read a file use unicode in windows 98
but it's allways fail !
please help me ande very thanks in advance!!
nothing
|
|
|
|
|
|
ebinaini wrote: ...but it's allways fail !
Define "fail."
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
i can't get the handle of file and i install MLU in windows 98
thanks in advance!
nothing
|
|
|
|
|
ebinaini wrote: i can't get the handle of file...
Why not? What does the code snippet look like that does not work?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
can anyone expain this logic flow!i mean the for loop makes no sense to me!...yet it works!and displays the map of india!
#include <stdio.h>
main()
{
int a,b,c;
int count = 1;
for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21]; )
for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1); return 0;
}
-- modified at 5:22 Wednesday 25th January, 2006
|
|
|
|
|
|
|
|
First shot:
namaskaaram wrote: a="- FIGURE?, UMKC,XYZHello Folks,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!"
This is the map of india, XORed with some easy key.
namaskaaram wrote: for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1); return 0;
This displays spaces or '!', ++c=='Z' ? c = c/ 9:33^b&1 being the decyphering code.
More in a while...
~RaGE();
|
|
|
|
|
Rage wrote: This displays spaces or '!', ++c=='Z' ? c = c/ 9:33^b&1 being the decyphering code.
we have a ?: operator here, so might be seen this way first :
putchar(
(++c == 'Z') ?
(c = c / 9) :
(33 ^ (b & 1))
);
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
More as promised:
namaskaaram wrote: a="- FIGURE?, UMKC,XYZHello Folks,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21];
for each step in this for loop:
1. b is increased by one in [b+++21], so you basically do b=10, b=11, b=12, and so on.
2. a is initialised to the value of the char placed in position b+21 as stated in [b+++21] in the map string.
3. the second for loop is executed. Let's have a closer look:
++c=='Z' ? c = c/ 9:33^b&1
this is equivalent to
if (c==30)
putchar(c=c/9);
else
putchar(33^b&1);
c++;
following happens in the for loop
3a. a is decreased by one, meaning you stay in this loop (a-64) times
3b. c is increased. If c is equal to 'Z'(=30), a return to carriage is printed, since ++c=='Z' ? c = c/ 9:33^b&1 returns c = c/9, and this is 10.
3c. otherwise, you return 33 Xored with b&1 which is either a space or a '!' char, which prints the map.
when the index b+21 exceeds the string length, the assignement a = string[b+21]is false, leaving the first for loop.
and finally, int count = 1; is of no use
Hope this helps.
~RaGE();
-- modified at 6:03 Wednesday 25th January, 2006
|
|
|
|
|
Rage wrote: if (c==30)
Is actually:
if (c == 90) thus dividing by 9 would yield 10, a newline character;
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
this is how we could see it in a better view :
<font color=blue>#include</font> <stdio.h>
<font color=blue>int main</font>(<font color=blue>void</font>) {
<font color=blue>int</font> a = 0,
b = 10,
c = 10; <font color=green>
<font color=blue>char</font>* pszMap =
<font color=gray>"- FIGURE?, UMKC,XYZHello Folks,"
"TFy!QJu ROo TNn(ROo)SLq SLq ULo+"
"UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^"
"NBELPeHBFHT}TnALVlBLOFAkHFOuFETp"
"HCStHAUFAgcEAelclcn^r^r\\tZvYxXy"
"T|S~Pn SPm SOn TNn ULo0ULo#ULo-W"
"Hq!WFs XDt!"</font>;
a = pszMap[b+21];
b++;
<font color=blue>while</font> (a != <font color=gray>'\0'</font>) {
<font color=blue>while</font> (a > 64) {
a--;
c++;
<font color=blue>if</font> (c == 'Z') {
c /= 9;
putchar(c);
}
<font color=blue>else</font> {
putchar(33 ^ (b & 1));
}
}
a = pszMap[b+21];
b++;
}
<font color=blue>return</font> 0;
}
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
|
|
toxcct wrote: i love that sort of tests
me too
#include "stdio.h"
main()
{
int b=0,c=0,q=60,_=q;for(float i=-20,o,O=0,l=0,j,p;j=O*O,p=l*l,
(!_--|(j+p>4)?fputc(b?q+(_/3):10,(i+=!b,p=j=O=l=0,c++,stdout)),
_=q:l=2*O*l+i/20,O=j-p+o),b=c%q,c<2400;o=-2+b*.05);
}
...
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
|
|
|
yes, it will work.
i forget how i worked that thing out, but i think the o gets initialized before its value is ever used for anything meaningful.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
ahh , i did not look correctly...
in for(float i=-20,o,O=0,l=0,j,p;j=O*..... , o is defined as a float, such as i, O, l, j, p...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
i don't have any compiler there, so tell me if i'm wrong :
<font color=blue>#include</font> <font color=gray>"stdio.h"</font> <font color=green>
<font color=blue>void main</font>(<font color=blue>void</font>) {
<font color=blue>int</font> b = 0,
c = 0,
q = 60,
_ = q;
<font color=blue>float</font> i = -20,
o = 0,
O = 0,
l = 0,
j = 0,
p = 0;
<font color=blue>do</font> {
j = O * O;
p = l * l;
<font color=blue>if</font> ((!_) | ((j+p) > 4)) {
i += !b;
p = j = O = l = 0;
<font color=blue>if</font> (b != 0) {
fputc((q + (_ / 3)), <font color=blue>stdout</font>);
}
<font color=blue>else</font> {
fputc(10, <font color=blue>stdout</font>);
}
c++;
}
<font color=blue>else</font> {
l = (2 * O * l) + (i / 20);
O = j - p + o;
}
_--;
b = c % q;
o = -2 + b * 0.05;
} <font color=blue>while</font> (c < 2400);
}
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
|