|
ok thanks it solve my first problem but yet:
[sajad@sajad Desktop]$ g++ c++file.cpp
c++file.cpp: In function ‘int main(int, char**)’:
c++file.cpp:66: error: ‘struct std::_List_iterator<code_ch>’ has no member named ‘begin’
c++file.cpp:66: error: ‘struct std::_List_iterator<code_ch>’ has no member named ‘end’
|
|
|
|
|
oh sorry ,it is a part of huge program so i only copy it and no member is in the list.but when i fix it and add:
for(int i=0;i<10;i++){
code_ch *h=new code_ch;
h->number=i;
h->ch='1';
w.push_front(*h);
}
or :
code_ch H;
H.number=10;
H.ch='k';
w.push_front(H);
yet the same problem.
|
|
|
|
|
True, you still have this problem. Why don't you take a closer look at it.
khomeyni wrote:
int main(int argc,char **argv)
{
if(argc==1)
{
cout<<"you haven't entered a file! exiting..."<<endl;
return 1;
}
list<code_ch>w;
int *a=new int [200];
for(int i=0;i<200;i++)
a[i]=0;
list<code_ch>::iterator l=w.begin();
cout<<"the list is:"<<endl;
copy(l.begin(),l.end(),ostream_iterator<code_ch>(cout," "));
}
;
And your error message was:
khomeyni wrote: c++file.cpp: In function ‘int main(int, char**)’:
c++file.cpp:66: error: ‘struct std::_List_iterator<code_ch>’ has no member named ‘begin’
c++file.cpp:66: error: ‘struct std::_List_iterator<code_ch>’ has no member named ‘end’
That says that your iterator does not have a begin or end member. It is right, iterators don't. What does have a begin and end? What is it that you want to be copying from?
You should be able to get it from here.
|
|
|
|
|
if you mean this?
adding this in the main:
for(int i=0;i<10;i++){
code_ch *h=new code_ch;
h->number=i;
h->ch='1';
w.push_front(*h);
}
or :
code_ch H;
H.number=10;
H.ch='k';
w.push_front(H);
yet the same problem.
|
|
|
|
|
No, I don't mean that.
Play closer attention to the error message and the line it is referring to. It is telling you what the problem is and where it is. Go over each part of that line and look for a difference between what you intended and what you wrote.
|
|
|
|
|
i can not understand:
even for this does not work:
list<int> PL;
PL.push_front(100);
list<int>::iterator p=PL.begin();
copy(p.begin(),p.end(),ostream_iterator<int>(cout," "));
cout<<endl;
while in another where i wrote:
list<code_ch>::iterator p=t.begin();
int i=0;
while(p!=t.end()){
heap[i]=*p;
p++;
i++;
heapsize++;
}
//part of a program
and correctly works.
does list has not such ability to iterate over list elements as i want to do?
|
|
|
|
|
ok i must write:
copy(x.begin(),w.end(),ostr.....)
very simple error and stupidly error !!!
thanks.
|
|
|
|
|
Good. You got it.
Though of course its:
copy(w.begin(),w.end(),ostr.....)
|
|
|
|
|
I know it's a little more than a little funny but I don't know how some process have the user name SYSTEM within the window task manager while they are not a system process. E.g some anti viruses and ...
|
|
|
|
|
SYSTEM is a user in the Windows system that has a different set of privileges than the interactive user.
This name of the user does not mean it only runs system processes.
For example, most of the services that you create are run in the SYSTEM user context.
|
|
|
|
|
Hi
I want to use CArchive to seek backward. I did following:
int CmyClass::Serialize(CArchive& ar)
{
...
ar >> bt;
ar >> bt;
...
----->>>> Move ar file pointer backward here.
}
How can I implement this? Or How can I stop CArchive moving forward while I read something from a file?
Thanks,
|
|
|
|
|
CArchive is not a file, it manages a number of internal data to handle the serialization process, that must remain synchronized with the file itself.
Unless you want to mess-up the file content, you shouldn't move any CArchive "file pointer" (note that CArchive does not define such concept) nor you uattempt any seek to the CFile associated with CArchive.
The proper way to do that is, after saving is finished, close the archive,
cleanup the application in-memory data,
open the archive again for reading (you'd better to constrict another one, not use the same) and read the data from it.
2 bugs found.
> recompile ...
65534 bugs found.
modified on Monday, January 25, 2010 4:50 AM
|
|
|
|
|
|
CODEPC wrote: I found lActual = 12283? What is wrong?
What are you expecting lActual to be? What is the current value of the file pointer prior to calling Seek() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Please be polite, and don't remove your post after they had been answered.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
hi,i want to build a mini webserver,in php,we can use "$_GET['param']" to get the params,when i receive the url like "GET /test/test.php?param1=test¶m2=123 HTTP/1.1" how to send the params to my php script file?
i try to execute "php.exe test.php -f param1=test param2=123",but it doesn't work ,when i seach on google ,find some about "cgi protocols" ,can anyone tell me how to do it?
|
|
|
|
|
tfzxyinhao wrote: hi,i want to build a mini webserver,in php
This is the C++ forum! Please read the guidelines and watch where you're posting what.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
because the webserver was waite by C++
|
|
|
|
|
Seems like you have $argc and $argv for using parameters from the command line, just like in C. If you execute php.exe from your webserver to execute php scripts i guess you will either have to pass parameters thoroguh $argv or maybe dump them into a temp file and then read them up in the php script, you could probably make a "converter", a php "header" or somesuch that would generate a "_GET array" from these parameters if you need that.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
hi Code-o-mat ,i try to test which way you give ,but is not work too ..
|
|
|
|
|
I found this info here[^], just go to this site and search for $argv or $argc on it, maybe you need to add this[^] to your php.ini or whatever config file.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
how does apache pass params to php?
|
|
|
|
|
Normally PHP runs as an Apache module and parameters are passed in a struct request_rec . If PHP scripts are run through CGI, then parameters are passed in environment variables as I explained in a previous message. Command line arguments aren't used in either case.
|
|
|
|
|
maybe struct request_rec is my want!
|
|
|
|
|
I don't know about that but i kinda doubt that apache executes php.exe "externally" to parse scripts, it probably has it built in or uses it in a DLL or library or such...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|