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

Managed C++/CLI

 
AnswerRe: WriteFile functionality Pin
led mike19-Dec-06 4:49
led mike19-Dec-06 4:49 
GeneralRe: WriteFile functionality Pin
g_sasha19-Dec-06 5:08
g_sasha19-Dec-06 5:08 
GeneralRe: WriteFile functionality Pin
led mike19-Dec-06 5:18
led mike19-Dec-06 5:18 
GeneralRe: WriteFile functionality Pin
g_sasha19-Dec-06 5:59
g_sasha19-Dec-06 5:59 
GeneralRe: WriteFile functionality Pin
User 58385219-Dec-06 12:05
User 58385219-Dec-06 12:05 
GeneralRe: WriteFile functionality Pin
g_sasha19-Dec-06 20:58
g_sasha19-Dec-06 20:58 
QuestionSystem::Windows::Forms Namespace ?? Pin
Fritzables18-Dec-06 15:03
Fritzables18-Dec-06 15:03 
AnswerRe: System::Windows::Forms Namespace ?? Pin
bsaksida18-Dec-06 19:49
bsaksida18-Dec-06 19:49 
GeneralRe: System::Windows::Forms Namespace ?? Pin
Fritzables19-Dec-06 12:45
Fritzables19-Dec-06 12:45 
AnswerRe: System::Windows::Forms Namespace ?? Pin
GirishKB19-Dec-06 19:36
GirishKB19-Dec-06 19:36 
GeneralRe: System::Windows::Forms Namespace ?? Pin
Fritzables19-Dec-06 20:07
Fritzables19-Dec-06 20:07 
GeneralRe: System::Windows::Forms Namespace ?? Pin
bsaksida19-Dec-06 20:40
bsaksida19-Dec-06 20:40 
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 

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.