|
I didnt see Stephen do anything bad.
He just referred him to the STL, and if the guy works it out from there,
I believe that is OK.
Even we need pointers to references some times.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
yeah, i understand this point of view and i conccur somewhat.
but what i also observe - sadly - is that many people (newly registered to codeproject) come there to ask for one to make one's homework
they not only miss the point of what homeworks are beeing for (to learn and progress) but they ask their question a somewhat hurting way...
i can used to newbies that don't know the site, don't know where to ask, and don't really know where to start with their assignment, but i can't used to those guys that tell you : "do this, so that, the program has to output/compute this or this datas"... hey, we're not paid to do one's job. we can only help or link someone to a possible/best way to solve a specific point.
i've quoted this from Bjarne Stroustrup's FAQ yesterday :
"Will you help me with my homework?
No. Sorry. I don't do (other people's) homework. I get too many requests for help with homework and help with finding bugs in student programs to be able to find the time. Anyway, having a distant expert fix your programs is not the best way to learn. Try finding a local person with C++ experience that you can ask for guidance. A good mentor is the best help a student can have; maybe that's why they are not easy to find.
Also, no, I will not suggest "a good project for a student to work on". My experience is that learning enough about a student and his/her course to know what level of difficulty is required and what kind of project is of interst takes time. To think of a good project is then non-trivial, and to explain exactly what the project is and how to approach it can take several messages and several hours. I just don't have that kind of time. Remember, these request come at least weekly. Finally, some students seem to have the idea that if I suggest a project, I am morally obliged to provide quite detailed help in its completion. "
do you better understand why i reacted like that ?
|
|
|
|
|
dude chilllll maaan... i didnt ask for the whole program.. thanx for the asnwer but i just asked for tips thats it... u dont hv to make a freakin conspiracy out of it..
|
|
|
|
|
If the homework was to "implement" a stack or queue then I didn't do it, I pointed him at existing implementations. It's all very trendy at the CodeProject to harp on about homework, and I agree that you shouldn't do a students work for him: But you don't have to put him in "solitary confinement". I just pointed the dude in the right direction (or as I said, possibly the wrong direction if the alleged assignment was to implement it yourself).
Steve
|
|
|
|
|
KOOOSHA wrote: can anyone help me with these?
Yes, exactly what is it that you need help with?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
i hv a stack ADT program. I hv to use it to implement a queue.. considerin the FIFO and LIFO rules for both of the structures i hv no freakin idea how to put it together....
-- modified at 10:35 Thursday 6th April, 2006
|
|
|
|
|
KOOOSHA wrote: i hv a stack ADT program. I hv to use it to implement a queue..
Not possible, technically. A queue is a FIFO data structure whereas a stack is a LIFO data structure. Since both of these are linked lists, however, it should be easy enough to implement. Consider:
class list
{
};
class queue : public list
{
};
class stack : public list
{
};
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all,
In my MDI application, I've written some code for print stuff [in OnPreparePrinting(..)]. It is just a single page document with max. 20 lines of text. It works fine with Laser printer. But I am getting more space between each line in Dot Matrix printer. Where am I wrong?
I am new to MFC Printing. If anyone could suggest me something, it would be more helpful.
Thanks in advance,
Sarvan AL
|
|
|
|
|
I have coded a simple program, as follows:
#include < string >
#include < vector >
using namespace std;
void main ()
{
string word;
vector < string > text;
}
When it is compiled,there are 4 warnings, and I can't solve them, what's wrong?
the warnings are:
D:\C learning\trytry\bbb.cpp(32) : warning C4786: 'std::reverse_iterator,std::allocator > const *,std::basic_string,std::allocator >,std::basic_stringar_traits,std::allocator > const &,std::basic_string,std::allocator > const *,int>' : identifier was truncated to '255' characters in the debug information
D:\C learning\trytry\bbb.cpp(32) : warning C4786: 'std::reverse_iterator,std::allocator > *,std::basic_string,std::allocator >,std::basic_stringits,std::allocator > &,std::basic_string,std::allocator > *,int>' : identifier was truncated to '255' characters in the debug information
d:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector,std::allocator >,std::allocator,std::allocator > >
>::vector,std::allocator >,std::allocator,std::allocator > > >' : identifier was truncated to '255' characters in the debug information
d:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector,std::allocator >,std::allocator,std::allocator > >
>::~vector,std::allocator >,std::allocator,std::allocator > > >' : identifier was truncated to '255' characters in the debug information
-- modified at 4:33 Thursday 6th April, 2006
|
|
|
|
|
there's no problem about this...
they are warnings, not errors.
compile in release mode and they won't appear anymore.
|
|
|
|
|
Thanks a lot!
and indeed there is another question:
void main ()
{
string word;
vector < string > text;
while ( cin >> word)
{
text.push_back( word );
}
cout << "words read are: \n";
for ( int ix = 0; ix < text.size(); ++ix)
{
cout << text[ ix ] << ' ';
}
cout << endl;
}
when run it, I should input the words into the " string word " from the keyboard, but how to terminate the input?
how to set ( cin >> word) " false " ?
-- modified at 4:53 Thursday 6th April, 2006
|
|
|
|
|
Ctrl + C
otherwise, you'll have to enter a particuliar string on the input stream, and test if the user input equals to the exiting string/condition...
|
|
|
|
|
Another option to disable these warnings (they are irrelevant) is to go in the properties of your project and there (in the C/C++ tab) you should be able to disable them.
|
|
|
|
|
this also works from code :
#pragma warning(disable : 4786)
|
|
|
|
|
Yes but the problem there is that the warning is coming from the STL itself, so, you have to put this pragma in each file you are dealing with vectors, strings, ...
Quite annoying, so it is easier to simply disable them in the properties of your project.
|
|
|
|
|
what about stdafx.h ?
|
|
|
|
|
Yes, but what if you don't use precompiled headers ?
Anyway, both solutions are correct
|
|
|
|
|
I always use a "stdstl.h" header that includes all the STL/Boost files I need, with the necessary pragmas to disable the warnings.
|
|
|
|
|
even precompiled headers are disabled, you can always provide the header, can't you ?
|
|
|
|
|
Cedric Moonen wrote: you should be able to disable them
This depends on the version of VC. In VC++ 6, even with SPs, there is a bug that does not make it possible to remove these warnings.
~RaGE();
|
|
|
|
|
I'd guess you’re using MSVC6. The debug format used with this version was designed before templates became so popular and can't cope with the long symbol names generated when templates are used. You can suppress then using #pragma warning(disable : 4786) . I usually put it in my "stdafx.h" file.
Steve
|
|
|
|
|
Hi,
i have just started learning Vc++. can any one help me with my problem.
i want to insert,delete an item to list box control how to do that?? and to insert folder name in list box? and also i want to access the each item(folder name).
please can anyone help me....
|
|
|
|
|
|
maybe it is some helpful to you
SetCurrentDirectory("c:\\");
m_List2.Dir(DDL_DIRECTORY|DDL_EXCLUSIVE, _T("*.*"));
//example
m_List2.DeleteString(0);
m_List2.AddString("Welcome");
m_List2.InsertString(0,"Hi");
|
|
|
|
|
Hi,
i just added addstring code to project for add button but i am getting the below error.
////code/////
void CUpdateDlg::OnAdd()
{
m_LIST.AddString("Welcome");
}
/////////////
Error:-
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(63) : error C2039: 'AddString' : is not a member of 'CString'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
Error executing cl.exe.
DesktopSearch.exe - 1 error(s), 0 warning(s)
Regards,
Parichay B.P
|
|
|
|