Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why do i get this ^@ when i attempt to access the first element of a CvMat data struct member?

when i run this code

  double a[]={1.0,2.0,3.0,4.0};
  CvMat M=cvMat(8,8,CV_8UC1, a);
  cout<<"M.data.ptr="<< M.data.ptr[0]<<endl;

to access a 1.0, the first element of the matrix, i get the output M.data.ptr=^@ oddly enough i tried copying the cout output into this ? and the ^@ wouldn't copy..i got only M.data.ptr when i pasted...I tied other variations like M.data.ptr[0] and M.data.ptr but just got normal error and null output for those 2 respectively. how would i go about accessing the 1.0 by dereferencing the data struct member and not using a function i/e cvGet2D...just in case its emacs thats doing this i thought id report im using Emacs on Ubuntu Saucy...

click to hide/show revision 2
retagged

Why do i get this ^@ when i attempt to access the first element of a CvMat data struct member?

when i run this code

  double a[]={1.0,2.0,3.0,4.0};
  CvMat M=cvMat(8,8,CV_8UC1, a);
  cout<<"M.data.ptr="<< M.data.ptr[0]<<endl;

to access a 1.0, the first element of the matrix, i get the output M.data.ptr=^@ oddly enough i tried copying the cout output into this ? and the ^@ wouldn't copy..i got only M.data.ptr when i pasted...I tied other variations like M.data.ptr[0] and M.data.ptr but just got normal error and null output for those 2 respectively. how would i go about accessing the 1.0 by dereferencing the data struct member and not using a function i/e cvGet2D...just in case its emacs thats doing this i thought id report im using Emacs on Ubuntu Saucy...

click to hide/show revision 3
retagged

Why do i get this ^@ when i attempt to access the first element of a CvMat data struct member?

when i run this code

  double a[]={1.0,2.0,3.0,4.0};
  CvMat M=cvMat(8,8,CV_8UC1, a);
  cout<<"M.data.ptr="<< M.data.ptr[0]<<endl;

to access a 1.0, the first element of the matrix, i get the output M.data.ptr=^@ oddly enough i tried copying the cout output into this ? and the ^@ wouldn't copy..i got only M.data.ptr when i pasted...I tied other variations like M.data.ptr[0] and M.data.ptr but just got normal error and null output for those 2 respectively. how would i go about accessing the 1.0 by dereferencing the data struct member and not using a function i/e cvGet2D...just in case its emacs thats doing this i thought id report im using Emacs on Ubuntu Saucy...