i ve already sent the total code...................
look
i have class like:
class Class
{
}
void func(){
std::list<Class> l;
l.push_back(Class(0));
l.push_back(Class(0));
func(&l);
}
i want to pass that list to different function but iits not working.............
like
void func2(list<Class> &l){
list<class>::iterator p=l.begin();
the element of the Class can not be accessed............................plz help
}//is not working..................
________________________________
From: Tyler Littlefield <[email protected]>
To: [email protected]
Sent: Tuesday, April 7, 2009 5:18:58 AM
Subject: Re: [c-prog] [C++: passing a list to a function --mod] plz help
me..................................its urgent.............
what about it.
Thanks,
Tyler Littlefield
Web: tysdomain.com
email: ty...@tysdomain. com
My programs don't have bugs, they're called randomly added features.
----- Original Message -----
From: Snit Roy
To: c-p...@yahoogroups. com
Sent: Monday, April 06, 2009 12:39 PM
Subject: Re: [c-prog] [C++: passing a list to a function --mod] plz help
me.......... .......... ......... .....its urgent...... .......
like list<class Class>&list like that
____________ _________ _________ __
From: Tyler Littlefield <ty...@tysdomain. com>
To: c-p...@yahoogroups. com
Sent: Monday, April 6, 2009 7:21:17 PM
Subject: Re: [c-prog] [C++: passing a list to a function --mod] plz help
me.......... ......... ......... ......its urgent....... .......
...referance. ..
...
...?
Thanks,
Tyler Littlefield
Web: tysdomain.com
email: ty...@tysdomain. com
My programs don't have bugs, they're called randomly added features.
----- Original Message -----
From: Snit Roy
To: c-p...@yahoogroups. com
Sent: Monday, April 06, 2009 12:09 AM
Subject: Re: [c-prog] [C++: passing a list to a function --mod] plz help
me.......... .......... ......... .....its urgent...... .......
as it was template i tried to pass the object referance... ......... ...
____________ _________ _________ __
From: Tyler Littlefield <ty...@tysdomain. com>
To: c-p...@yahoogroups. com
Sent: Monday, April 6, 2009 8:24:12 AM
Subject: Re: [c-prog] [C++: passing a list to a function --mod] plz help
me.......... .......... ......... .....its urgent...... .......
pass a pointer to the list.
Thanks,
Tyler Littlefield
Web: tysdomain.com
email: ty...@tysdomain. com
My programs don't have bugs, they're called randomly added features.
----- Original Message -----
From: coolsa...@ymail. com
To: c-p...@yahoogroups. com
Sent: Saturday, April 04, 2009 4:00 PM
Subject: [c-prog] [C++: passing a list to a function --mod] plz help
me.......... . ......... .......... .....its urgent...... ........
[Moderator- The subject line should reflect the nature of the
post, not its perceived priority. --mod PN]
i am using C++ on msvc++ 2008 sp1......... .now my question is how can i pass
the stndrd template list to a different function void block_separation(
IplImage *,IplImage *,list<col_info> &)?????????? ????????? ????????? ?????i am
giving both function definition here.......
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include<stdio. h>
#include<iostream>
#include<list>
#include<cstdlib>
using namespace std;
void show_image(IplImage *);
IplImage* binary(IplImage *);
int mode_calculation( IplImage *);
//void vertical_histogram( IplImage *);
IplImage * vertical_histogram( IplImage* );
IplImage * converting_to_ connected_ string(IplImage *,int);
void block_separation( IplImage *,IplImage *,list<class col_info>&list) ;
struct col_info
{
public:
int x_start;
int y_cor_val;
int x_end;
//int y_end;
public:
col_info(){}
col_info(int x_s,int x_e){ x_start=x_s; x_end=x_e; }
col_info(int y){y_cor_val= y;}
};
void col_sep2(IplImage * img){
IplImage * con_string=converti ng_to_connected_ string(img, 30);
int i,j,k,i1=0;
int step1 = img->widthStep/ sizeof(uchar) ;
int count=0,flag= 0,count1= 0;
list<col_info> l;
for(j=0;j<con_ string->width; j++)
{
for(i=0;i<con_ string->height; i++){
if(CV_IMAGE_ ELEM(con_ string,uchar, i,j)==255)
count++;
else if(CV_IMAGE_ ELEM(con_ string,uchar, i,j)==0 && count<300)
count=0;
}
if(count>300) {
count1++;
count=0;
}
if(count1>10)
{
for(i=0;i<con_ string->height; i++){
k=i;
if(CV_IMAGE_ ELEM(con_ string,uchar, i,j)==255)
count++;
else if(CV_IMAGE_ ELEM(con_ string,uchar, i,j)==0 && count<300)
count=0;
if(count>300)
{
i1=k-count;printf( "i1=%d",i1) ;
while(CV_IMAGE_ ELEM(con_ string,uchar, i1,j)==255)
{
con_string-> imageData[ i1*step1+ (j-(count1/ 2))]=0;
i1++;
}
l.push_back( col_info( k-count,i1) );
l.push_back( col_info( j));
count=0;
}
}
count1=0;
}
}
cvSaveImage( "D:/outdir/ imkcon.jpg" ,con_string) ;
show_image(con_ string);
block_separation( img,con_string, list<col_ info> &l);
}
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include<stdio.. h>
#include<iostream>
#include<list>
#include<cstdlib>
#include<cmath>
using namespace std;
void show_image(IplImage *);
IplImage* binary(IplImage *);
int mode_calculation( IplImage *);
void col_sep(IplImage *,int);
class col_info;
void block_separation( IplImage *img,IplImage *cols,list<col_ info> &l){
list<col_info> ::iterator p=l.begin();
//while(p!=l. end())
//{
// p++;
//}
//int i,j,k;
//for(i=0;i< img->hight; i++)
//{
// for(j=0;j<img- >width;j+ +)
// {
// if(CV_IMAGE_ ELEM(img, uchar,i,j) ==0)
//IplImage* img = cvCreateImage( cvSize((img- >width),img- >height),
img->depth, img->nChannels) ;
}
i am getting error like:
1>------ Rebuild All started: Project: cvTest, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'cvTest', configuration
'Debug|Win32'
1>Compiling. ..
1>stdafx.cpp
1>Compiling. ..
1>binary.cpp
1>block_separation. cpp
1>col_sep.cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep.cpp( 61) : warning
C4309: '=' : truncation of constant value
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep.cpp( 55) : warning
C4101: 'val' : unreferenced local variable
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep.cpp( 67) : warning
C4101: 'col_val' : unreferenced local variable
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep.cpp( 40) : warning
C4101: 't' : unreferenced local variable
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep.cpp( 67) : warning
C4101: 'row_val' : unreferenced local variable
1>col_sep2.cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep2. cpp(23) : warning
C4099: 'col_info' : type name first seen using 'class' now seen using 'struct'
1> d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep2.. cpp(20) : see
declaration of 'col_info'
1>d:\visual studio 2008\projects\ cvtest\cvtest\ col_sep2. cpp(92) : error
C2275: 'std::list<_ Ty>' : illegal use of this type as an expression
1> with
1> [
1> _Ty=col_info
1> ]
1>coloumn_detection .cpp
1>converting_ to_connected_ string.cpp
1>cvTest.cpp
1>horizontal_ projections_ within_boundary. cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ horizontal_ projections_
within_boundary. cpp(31) : warning C4309: '=' : truncation of constant value
1>mode_calculation. cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ mode_calculation .cpp(64) :
warning C4018: '<' : signed/unsigned mismatch
1>para_sep.cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ para_sep. cpp(42) : warning
C4101: 'l' : unreferenced local variable
1>d:\visual studio 2008\projects\ cvtest\cvtest\ para_sep. cpp(42) : warning
C4101: 't' : unreferenced local variable
1>show_image. cpp
1>vertical_histogra m.cpp
1>d:\visual studio 2008\projects\ cvtest\cvtest\ vertical_ histogram. cpp(32) :
warning C4309: '=' : truncation of constant value
1>Generating Code...
1>Build log was saved at "file://d:\Visual Studio 2008\Projects\ cvTest\cvTest\
Debug\BuildLog. htm"
1>cvTest - 1 error(s), 11 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]