Click here to Skip to main content
15,886,806 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: System::Windows::Forms Namespace ?? Pin
Fritzables19-Dec-06 21:06
Fritzables19-Dec-06 21:06 
GeneralRe: System::Windows::Forms Namespace ?? Pin
GirishKB19-Dec-06 20:41
GirishKB19-Dec-06 20:41 
GeneralRe: System::Windows::Forms Namespace ?? Pin
Fritzables19-Dec-06 21:04
Fritzables19-Dec-06 21:04 
GeneralRe: System::Windows::Forms Namespace ?? Pin
Fritzables20-Dec-06 10:13
Fritzables20-Dec-06 10:13 
GeneralRe: System::Windows::Forms Namespace ?? Pin
GirishKB20-Dec-06 16:34
GirishKB20-Dec-06 16:34 
QuestionUsing HtmlHelp API from C++ Pin
ankit_cse18-Dec-06 12:37
ankit_cse18-Dec-06 12:37 
QuestionRun time Error Pin
Programm3r18-Dec-06 5:24
Programm3r18-Dec-06 5:24 
Questionpointers to functions Pin
emrah.a17-Dec-06 3:49
emrah.a17-Dec-06 3:49 
Hi,

I am new to c++ and I will use it in my thesis on image processing.

I wrote a piece of code to read a ppm image file. in order to read the magic number (the number indicating the type of the image file whether it is ppm, bmp, jpeg or etc. this magic number is in the header section of the image) i create a char pointer magicNumber:

char *magicNumber;<br />
magicNumber = new char[2];// my aim is to create a pointer just to copy the "P6", i tried using malloc, but it did not fix 


and pass it into the function PPMreadHeader. My intent is to fill the pointer inside the function and write the magicnumber in the console outside the function.

i have an array in the PPMreadHeader fuinction in order to read the file line by line. I have a local char pointer "word":
<br />
char line[255];<br />
char * word;


when i read the magicnumber (it is "P6" for ppm files) i assign it to the local pointer word:

word=line;

if i try to write the magic number in the function using the local pointer:

cout<<word<<endl;

there is no problem, it writes p6 to the console. however, if i first copy the word into the magicnumber pointer that i create in the main function:

*magicNumber=*word;<br />
*(magicNumber+1)=*(word+1);



and then try to print out the pointer to the consolelike below:

cout<<"magicNumber: "<<magicNumber<<endl;

then it writes:

magicNumber:P6ııııİİ

which not i want. it writes the p6 which is what i want to write to the console, but it writes more than p6. within the function when i write the local pointer "word" it just writes the P6, nothing more. Could you please help me on this.

You may advise other alternatives to write the magic number on to the console but even you do this, i still want to learn what is wrong with my coding. i spent a lot of time on this and i could not fix it.

Thank you in advance.
GeneralRe: pointers to functions Pin
bsaksida17-Dec-06 4:58
bsaksida17-Dec-06 4:58 
QuestionMuthithreading Pin
bsaksida16-Dec-06 11:22
bsaksida16-Dec-06 11:22 
AnswerRe: Muthithreading Pin
Mark Salsbery16-Dec-06 12:47
Mark Salsbery16-Dec-06 12:47 
GeneralRe: Muthithreading Pin
bsaksida16-Dec-06 23:22
bsaksida16-Dec-06 23:22 
AnswerRe: Muthithreading Pin
Michael Dunn16-Dec-06 12:51
sitebuilderMichael Dunn16-Dec-06 12:51 
QuestionQuestion about the built in memory leak detection in vs05 Pin
FocusedWolf15-Dec-06 14:45
FocusedWolf15-Dec-06 14:45 
AnswerRe: Question about the built in memory leak detection in vs05 Pin
George L. Jackson15-Dec-06 20:12
George L. Jackson15-Dec-06 20:12 
AnswerRe: Question about the built in memory leak detection in vs05 Pin
Mark Salsbery16-Dec-06 10:53
Mark Salsbery16-Dec-06 10:53 
GeneralRe: Question about the built in memory leak detection in vs05 Pin
FocusedWolf16-Dec-06 15:09
FocusedWolf16-Dec-06 15:09 
QuestionHosting a Windows Forms Control in a MFC ActiveX control Pin
sps-itsec4615-Dec-06 6:59
sps-itsec4615-Dec-06 6:59 
AnswerRe: Hosting a Windows Forms Control in a MFC ActiveX control Pin
sps-itsec463-Jan-07 0:56
sps-itsec463-Jan-07 0:56 
QuestionOverride property Pin
bsaksida15-Dec-06 4:47
bsaksida15-Dec-06 4:47 
AnswerRe: Override property Pin
George L. Jackson15-Dec-06 20:28
George L. Jackson15-Dec-06 20:28 
GeneralRe: Override property Pin
bsaksida16-Dec-06 11:18
bsaksida16-Dec-06 11:18 
QuestionMulti Instance. Pin
bsaksida15-Dec-06 1:21
bsaksida15-Dec-06 1:21 
AnswerRe: Multi Instance. Pin
prasad_som15-Dec-06 2:38
prasad_som15-Dec-06 2:38 
GeneralRe: Multi Instance. Pin
bsaksida15-Dec-06 4:48
bsaksida15-Dec-06 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.