Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Writing raw data in byte form to Network Adapter w/ C++ Pin
Code-o-mat1-May-09 22:50
Code-o-mat1-May-09 22:50 
AnswerRe: Writing raw data in byte form to Network Adapter w/ C++ Pin
Jonathan Davies2-May-09 3:23
Jonathan Davies2-May-09 3:23 
AnswerRe: Writing raw data in byte form to Network Adapter w/ C++ Pin
TheScientistIsDead2-May-09 7:54
TheScientistIsDead2-May-09 7:54 
Questionhelp with implementation of strspn( ) Pin
kaku_lala1-May-09 15:44
kaku_lala1-May-09 15:44 
QuestionRe: help with implementation of strspn( ) Pin
David Crow1-May-09 16:11
David Crow1-May-09 16:11 
AnswerRe: help with implementation of strspn( ) Pin
Stuart Dootson1-May-09 16:15
professionalStuart Dootson1-May-09 16:15 
Questionwhat is wrong with this code snippet - memset() implementation Pin
kaku_lala1-May-09 15:42
kaku_lala1-May-09 15:42 
AnswerRe: what is wrong with this code snippet - memset() implementation Pin
Stuart Dootson1-May-09 16:11
professionalStuart Dootson1-May-09 16:11 
How are you using the function? It looks OK to me and works fine when used as per its signature, like so:

#include <iostream>

void *memset(char *s, char c, size_t n)
{
  size_t i;
  for (i = 0; i < n; i++, s++)
  {
    *s = c;
  }
  return s;
}

int main(int, char**)
{
   char p[100] = {0};
   memset(p, 'd', 10);
   std::cout << p << std::endl;
}


Compiles, links and runs OK (as I would expect) with gcc 4.0.1.

[edit]
kaku_lala wrote:
Return s.

That's the bit that your program probably doesn't do according to the spec (although the spec as given is ambiguous, to be honest).
[/edit]

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: what is wrong with this code snippet - memset() implementation Pin
David Crow1-May-09 16:15
David Crow1-May-09 16:15 
AnswerRe: what is wrong with this code snippet - memset() implementation Pin
Joe Woodbury1-May-09 19:32
professionalJoe Woodbury1-May-09 19:32 
QuestionOperator overloading and chaning streaming operators Pin
squall231-May-09 14:04
squall231-May-09 14:04 
AnswerRe: Operator overloading and chaning streaming operators Pin
Stuart Dootson1-May-09 16:06
professionalStuart Dootson1-May-09 16:06 
GeneralRe: Operator overloading and chaning streaming operators Pin
squall232-May-09 1:41
squall232-May-09 1:41 
QuestionHow do I debug a release build? Pin
bulg1-May-09 10:42
bulg1-May-09 10:42 
AnswerRe: How do I debug a release build? Pin
Rolf Kristensen1-May-09 11:31
Rolf Kristensen1-May-09 11:31 
GeneralRe: How do I debug a release build? Pin
bulg1-May-09 13:51
bulg1-May-09 13:51 
GeneralRe: How do I debug a release build? Pin
Stuart Dootson1-May-09 15:22
professionalStuart Dootson1-May-09 15:22 
QuestionPutting out plain text Pin
BobInNJ1-May-09 8:09
BobInNJ1-May-09 8:09 
QuestionRe: Putting out plain text Pin
David Crow1-May-09 8:19
David Crow1-May-09 8:19 
AnswerRe: Putting out plain text Pin
BobInNJ1-May-09 10:00
BobInNJ1-May-09 10:00 
GeneralRe: Putting out plain text Pin
David Crow1-May-09 10:03
David Crow1-May-09 10:03 
QuestionRe: Putting out plain text Pin
Maximilien1-May-09 8:24
Maximilien1-May-09 8:24 
AnswerRe: Putting out plain text Pin
Chris Losinger1-May-09 9:07
professionalChris Losinger1-May-09 9:07 
GeneralRe: Putting out plain text Pin
BobInNJ2-May-09 4:41
BobInNJ2-May-09 4:41 
Questionshow the picture in the same window of MFC insted of showing in new window Pin
trinhminhson1-May-09 8:00
trinhminhson1-May-09 8:00 

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.