I have found this tutorial online, which looks immensely helpful but unfortunately is for a previous version of Qt and is thus outdated:
What version of QT is used in the Tutorial? What version are you using?
I have found this tutorial online, which looks immensely helpful but unfortunately is for a previous version of Qt and is thus outdated:
What version of QT is used in the Tutorial? What version are you using?
OP means Original Poster, and that is you.
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(57) : error C2065: 'c_file' : undeclared identifier
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(57) : error C2228: left of '.attrb' must have class/struct/union
1> type is ''unknown-type''
c_file is being used before declaring it. That is the reason for the above error.
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(64) : error C2065: '“c' : undeclared identifier
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(64) : error C2143: syntax error : missing ')' before ':'
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(64) : error C2017: illegal escape sequence
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(64) : error C2017: illegal escape sequence
1>c:\users\1014034\documents\visual studio 2008\projects\p1 2\p1.cpp(64) : error C2059: syntax error : ')'
The “”
in _chdir ( “c: \\dir1” );
are in an un-ascii code. That is why the errors in line 64 shows up. The compiler can't process it.
Replace it to _chdir ( "c:\\dir1" );
and errors in line 64 should dissappear. Better to type it by hand and see.
Anyway the below snippet should work.
_finddata_t c_file;
intptr_t hFile;
_chdir ( "c:\\dir1" );
// Find any file in current directory
if( (hFile = _findfirst( "*.*", &c_file )) == -1 ){
cout <<"Error! :" << errno << endl; // This doesn't mean current directory is empty.
}
else
{
do {
// if the file is not a sub dir...
if( ( c_file.attrib & _A_SUBDIR ) != _A_SUBDIR ){ // _A_SUBDIR = 0x10 (16 in decimal). Also note the single &.
cout << …
AD,
The OP is using the direct.h header so she is probably using the Digital Mars libraries. There can be various reasons the code is failing, incorrect input, spaces between directory names, etc. So without information from the OP on where it is actually failing, we don't have any way of resolving this issue.
Okay. So from what I understand, before setting up OpenCV, you have to setup Eclipse so that you can compile and link a basic C/C++ program, right?
Follow this link, and see if you can get to compile, link and run a basic Hello World program.
If you can't, post the problems you are having.
If you can, continue with the OpenCV setup for Eclipse.
No. I use visual studio. What problems are you facing when you follow the given link? Please be as descriptive as possible.
Do you know the meaning of this?
A square has 4 vertex then the degree of each vertex is 2.
If you just Googled "OpenCV and Eclipse CDT", you would have found this, and a lot of other helpful links, and saved the time taken to type and post in multiple forums.
My problem is that I can't get the blasted file(s) read in! I can read a single file (e.g."junk.txt") and do the comparisons, but I can't get the directory file thing to work. Also, one type of file (jpg) will be of an indeterminate size.
What does "directory file thing" mean exactly?
What part of the program fails? What is the last line of output you see?
Well, from how I see it, if the users find the new Google results push the more informative content down the list, they will move to a better search engine. I remember using Yahoo search as my primary search engine in the early 2000s but moving to Google for the same reason. Let's see what happens. It is the users who decide finally. Content doesn't get better just because it figures in the top of some machine generated list.
Since I am in Japan, I have no experience with the changes made by Google.
But a simple collection of keywords may have worked before to get traffic, but now, quality will have to be given importance above quantity. Not only the answers, but also the questions. I rarely wander out of the C/C++ forums, and there I think 90% of the questions are beginner level questions. Even then, considering the simplicity of the question, the depth of the thread is ridiculously too long. It takes at least 3-4 posts to get the OP to post some code. Developers don't have time to wade through dozens of pages to find a solution. It gets boring and wastes time. That is why Wikipedia is in the top of the search results. It may not have the complete answer, but it is a great starting point for anyone who is not a free loader. I for once haven't come across Daniweb during my work related Google searches. My main hits have been Wikipedia, Stackoverflow, Embedded.com etc. And they point me in the correct direction.
I read in a previous thread, that Dani has made changes targeting more advanced developers from the US/CANADA to post here more, so things will improve. But it won't be easy to reverse the damage the broken English homework students have done in these past 5-6 years.
Moderators will have to pay a lot of attention on the quality of the answers and …
Lines 23 to 25 in your code seems to be useless. I don't think there is the need to move to the end of List1 in order to update LastNode which needs no updating.
Did a rewrite. Maybe buggy since I don't have the class declaration of node, so use it as an algorithm at best.
//overloaded plus equal (+=) operator
//data hold the data for the Node and next points to next node
OList & operator += (const OList & other) {
Node<T> *temp;
Node<T> *p1 = head; //list on the left of operation a+=b
Node<T> *p2 = other.head; //list on the right
size += other.size; //change size of current list to list size += right list size
// Assumes P1 and P2 are already sorted
// Haven't reached the end of List1 or List2?
while ( p1 != NULL && p2 != NULL ) {
// For each P2 in List2, find P1 in List1 where P1.data > P2.data, and insert P2
if (p1->data > p2->data) {
temp = createNode(p2->data);
temp->next = p1->next;
p1->next = temp;
p2 = p2->next; // Advance to the next item in List2
}
p1 = p1->next; // Advance to the next item in List1
}
if (p2 == NULL){ // End of List2 reached or List2 was empty from the start
// All elements of p2 have been inserted to List1.
// Nothing else to do.
}
else{ // Some items are left in List2
// Append copies of remaining items …
Explaination is the same as what navedalam said. But I am surprised that this even compiles. At least there should be some compiler warnings. In any case, this kind of usage has to be handled with great care. int *ptr=10,j;
ptr
is a pointer to int
. j
is an int
.
The types are different. So you won't be able to assign one to the other without a cast
.
int *ptr = (int*)10, j;
j = (int)(ptr+19);
You have created a Win32 Console Project
. Select Win32 Project
The problem must be with how the assignment operator (operator=)
is implemented. Is there any documentation regarding that?
Post what you have done up to now.
Ah I see. Thanks both of you.
Isn't tagging it incorrectly, like posting C/C++ posts in the Web Development forum?
What is this user's deal anyway? What possible interest can he have in retweeting Daniweb posts blindly like that? And why #webdevelopment. I would ask him, but don't know who he is. Any ideas?
Isn't it odd that content with no relevance to Web Development are tagged as webdevelopment?
Without replacing the digits with x as you find them, remember the first digit you encounter while you scan the string. Move ahead until you find a non-digit. Replace sub-string from the first digit to the one before the non-digit with a single "X".
There are many ways to do this, but one basic algorithm would be as below.
Number_Start_Pos = -1
Number_End_Pos = -1;
read character while not end of string{
If ( ( Character is a digit ) AND ( Number_Start_Pos == -1 ) ){
Number_Start_Pos = current_position;
}
If ( ( Character is not a digit) AND ( Number_Start_Pos != -1 ) ) {
Number_End_Pos = current_position - 1 ;
Replace( Number_Start_Pos to Number_End_Pos with "X" );
Number_Start_Pos = -1;
Number_End_Pos = -1;
}
}
Why do even C/C++ posts have the #webdevelopment tag(?) when retweeted? What is going on?
WWW.DANIWEB.COM - #webdevelopment : Getting argv[] command line arguments.: Hello, Simple question this time, I ho... http://bit.ly/grklp6 #harshgandhitk
You code? Really?
Read the documentation. Much of programming is basically figuring out how to use the building blocks given in a library to build what you want. Nobody can do the thinking for you.
AXIMP seems to be related to VB6 Active X controls. Give details of the project.
I haven't personally come along these type of errors in my work, but maybe someone else who are doing the same kind of projects may have and will be able to help.
Do you want the above function to be called when button "Hello" is clicked?
are there any solutions?
Without knowing what you want to do, we can't give any.
Learn to properly format the question.
preview
functionality and see if the code looks good before posting, or use the edit functionality to edit it if it doesn't look good after posting. I would recommend using 4 SPACES instead of the TAB character to indent.WM_CREATE
is handled multiple times. So only the one at the top is called and the code that handles the WM_CREATE
s below it, which are the ones supposed to create the other 2 buttons, are not called. Why do you handle the same message in various parts of the code? I can't judge if it is by mistake or not because you haven't said WHEN you want the buttons to be displayed. If you want to make the buttons appear at …Can't you just use fileOut << linea <<"</br>" <<endl;
in line 34?
Also delete
the memory allocated for ImageData
after you've finished.