|
hung2h wrote: well, i m trying to implement stack structure with C++.
YOu may also use the std::stack , see [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Isn't that cheating for homework?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Nah, it is 'smart usage of available technology'
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
The way I read this, you want to #include "sc.h" in frst.h and #include "th.h" in sc.h, but not #include "frst.h" in th.h? WQell, surely you just need to put the appropriate #include lines in frst.h and sc.h as below?
Put this line at the start of frst.h
#include "sc.h"
Put this line at the start of sc.h
#include "th.h"
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
More information might be useful, but I'd suggest reading about Forward Declarations[^] as a good place to start.
Steve
|
|
|
|
|
Right, I'll do it with forward declaration. Thanks for answers.
|
|
|
|
|
Hi all, I am new to the forum. I am currently using C program to communicate with PIC18F2620 and using TR800 to transmit text message to hand phone. I am trying to power on, reset and set the baud rate without using Hyper terminal. I am currently having some difficulty in doing that. Any help would be gratefully appreciated. Thanks in advance. Below is the code snippet.
void setup_gsm(void)
{
PWON = 1;
Delay10KTCYx(40);
RESET = 0;
putrsUSART ((const far rom char *)"AT\r");
Delay10KTCYx (50);
RESET = 0;
putrsUSART ((const far rom char *)"AT+IPR=115200\r");
Delay10KTCYx (50);
RESET = 0;
putrsUSART ((const far rom char *)"ATE=0\r");
Delay10KTCYx (50);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CLIP=1\r");
Delay10KTCYx (10);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CMEE=1\r");
Delay10KTCYx(10);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CMGF=1\r");
Delay10KTCYx(10);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CMGS=+phonenumber\r\n");
Delay10KTCYx (10);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CNMI=0,0,0,0,0\r");
Delay10KTCYx (10);
RESET = 0;
putrsUSART ((const far rom char *)"AT+CPBS="SM\"\r");
Delay10KTCYx (50);
}
modified on Wednesday, January 20, 2010 4:03 AM
|
|
|
|
|
CodeyBlank wrote: I am currently having some difficulty
Sorry, but we cannot guess what that difficulty may be. Please explain what the problem is. Does the code fail, and if so what happens - error code, abort, crash etc?
MVP 2010 - are they mad?
|
|
|
|
|
rats - you got there before me ...
'g'
|
|
|
|
|
Still amazes me how many people think we can (read minds).
MVP 2010 - are they mad?
|
|
|
|
|
Richard MacCutchan wrote: Still amazes me how many people think we can (read minds).
Since I know 'a priori' that, it doesn't amaze me: yes we can (not in Massachusetts, however).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
MVP 2010 - are they mad?
|
|
|
|
|
ok, are we supposed to guess whats happening (or not happening) ?
a) ie, where does it fail ?
b) have you single-stepped through it in debug mode ?
c) is there some sort of run-time error or any other diagnostics in your system ?
most guys would love to be able to help, but we dont read minds (my own is bad enough !!)
'g'
|
|
|
|
|
I am able to send text message when using Hyper Terminal but currently I am making it run without Hyper Terminal. There is no compiling error, but it can't send out any text message. Hoping to know is there any logic error. Please guide me along. Thank you
|
|
|
|
|
the problem is the command set would be unknown to most of us here.
a) how do you verify that the commands you're sending programmatically to the device are being received and acted on - there doesnt seem to be any status returns/checks from [putrsUSART] - you've just said do a,b,c,d etc, and there doesnt seem to be any return saying the commands are accepted or not - if you were calling a function of your own, for example, you'd have some sort of return indicator to say the function worked or not wouldnt you ?
b) what commands do you issue in hyperterm ? list them
c) if you compared those commands from (b) to what you think your code is doing, is it doing fundamentally the same ?
thats where I'd start
'g'
|
|
|
|
|
Hi,
Anyone knows how to split the tif file using CXImge library?
Thanks,
|
|
|
|
|
i am also used cxImage library ..but i coudnt understood what u need ?can u explain .... little more
Failure is Success If we learn from it!!
|
|
|
|
|
Hi,
I am having multipage tiff file. I want to convert to separate files. Is there any function in CXImage library to split multipage tiff files?
Thanks,
|
|
|
|
|
I do not know about CxImage, but Gdiplus::Image can do it easily via calls to GetFrameCount() and SelectActiveFrame() .
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
in vc2008:
#include <fstream><br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#endif
----compile success
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#endif<br />
#include <fstream>
----compile error
d:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2365: “operator new”: redefinition.....
can anybody explain?
modified on Wednesday, January 20, 2010 7:14 PM
|
|
|
|
|
one of those #includes is defining its own version of new ?
|
|
|
|
|
but why:
#include <fstream>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
----can compile success?
|
|
|
|
|
Hello all,
I am working on my homework for my C++ programming class and I am hitting a brick wall. Everywhere I look online does not seem to have any information in which I can apply to my program. I am supposed to use a "while" loop which I am, and thats working.
The part which is not working is the users input should add it to the previous entry, and after the user types "0" it will display the sum on the screen. I have looked at the following references to try and make sense of things:
http://www.cplusplus.com/reference/std/numeric/partial_sum/[^]
http://www.cplusplus.com/reference/std/numeric/accumulate/[^]
http://frank.mtsu.edu/~csci117/manual/lab7/lab7.html[^]
I am trying very hard to understand this, but I can not find a good online reference of the libraries. www.cplusplus.com is very good but dosent have the info I need, or more than likely I can not find it.
But here is the code to which I am trying to correct:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int userinput;
int sum = 0;
sum = sum + userinput;
while (userinput != 0)
{
cout << "Please enter a number. When you are finished, type 0 and press Enter." ;
cin >> ++userinput ;
}
cout << "The sum is:" << sum << endl;
return 0;
}
Thank's to all in advance for pointing me in the correct direction so I can figure this out. I should have put this at the top: I DO NOT WANT THE ANSWER, I WOULD PREFER THE REFERENCE TO FIND MY OWN.
|
|
|
|
|
Outside the loop you should initialize the variable "userinput". The statement
sum = sum + userinput
before the loop should be removed. This statement should appear somewhere inside the loop. Also, for this you can use the += operator instead. The ++userinput inside the loop should just be userinput without the ++ operator.
The variables "userinput" and "sum" are not "Global Variables". They are local to the function "main".
You need to work out the details.
|
|
|
|