Click here to Skip to main content
15,911,707 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need assistance accessing FMTID Pin
Jeffrey Walton3-Nov-05 9:21
Jeffrey Walton3-Nov-05 9:21 
QuestionComplete Vector elements deletion Pin
itkid1-Nov-05 6:28
itkid1-Nov-05 6:28 
AnswerRe: Complete Vector elements deletion Pin
Maximilien1-Nov-05 6:34
Maximilien1-Nov-05 6:34 
AnswerRe: Complete Vector elements deletion [edited] Pin
toxcct1-Nov-05 6:36
toxcct1-Nov-05 6:36 
GeneralRe: Complete Vector elements deletion [edited] Pin
itkid1-Nov-05 7:44
itkid1-Nov-05 7:44 
GeneralRe: Complete Vector elements deletion [edited] Pin
Kevin McFarlane1-Nov-05 10:15
Kevin McFarlane1-Nov-05 10:15 
QuestionDNS program Pin
c++code1011-Nov-05 5:54
c++code1011-Nov-05 5:54 
QuestionGoogolplex Program Pin
ericelysia1-Nov-05 5:03
ericelysia1-Nov-05 5:03 
Hello,

I found this program online. I think it might be written in C.

Can someone convert this to Visual C++ for me?

I would like to show my wife that she cannot visualize what a googolplex is.

Thanks,
Eric
<br />
#include <stdio.h><br />
#include <stdlib.h><br />
<br />
int main (int argc, char *argv[])<br />
{<br />
  int *vals, *ptr, max;<br />
<br />
  if (argc == 2)<br />
    max = atoi (argv[1]);<br />
  else<br />
    max = 100;<br />
<br />
  printf ("1");<br />
<br />
  if ((vals = malloc ((max + 1) * sizeof (int))) == NULL) {<br />
    fprintf (stderr, "Error allocating memory.\n");<br />
    return 1;<br />
  }<br />
<br />
  memset (vals, '\0', (max + 1) * sizeof (int));<br />
<br />
  while (!vals[max]) {<br />
    *(ptr = vals) += 1;<br />
<br />
    while (*ptr == 10) {<br />
      *ptr++ = 0;<br />
      *ptr  += 1;<br />
    }<br />
<br />
    printf ("0");<br />
  }<br />
  printf ("\n");<br />
  free   (vals);<br />
  return 0;<br />
}<br />
<br />

AnswerRe: Googolplex Program Pin
Maximilien1-Nov-05 5:32
Maximilien1-Nov-05 5:32 
AnswerRe: Googolplex Program Pin
David Crow1-Nov-05 5:38
David Crow1-Nov-05 5:38 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 5:56
ericelysia1-Nov-05 5:56 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:23
toxcct1-Nov-05 6:23 
GeneralRe: Googolplex Program Pin
David Crow1-Nov-05 7:14
David Crow1-Nov-05 7:14 
AnswerRe: Googolplex Program Pin
toxcct1-Nov-05 6:13
toxcct1-Nov-05 6:13 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:22
ericelysia1-Nov-05 6:22 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:29
toxcct1-Nov-05 6:29 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:39
ericelysia1-Nov-05 6:39 
Questionget bit rate supported by a portable device Pin
decang1-Nov-05 5:00
decang1-Nov-05 5:00 
QuestionLooking for API method to find component version ... Pin
Yanshof1-Nov-05 4:00
Yanshof1-Nov-05 4:00 
AnswerRe: Looking for API method to find component version ... Pin
Chris Losinger1-Nov-05 4:44
professionalChris Losinger1-Nov-05 4:44 
Questionif (23 == x) or if (x == 23) Pin
Anorexic Tribble1-Nov-05 2:58
Anorexic Tribble1-Nov-05 2:58 
AnswerRe: if (23 == x) or if (x == 23) Pin
Justin Hallet1-Nov-05 3:11
Justin Hallet1-Nov-05 3:11 
AnswerRe: if (23 == x) or if (x == 23) Pin
grigsoft1-Nov-05 3:16
grigsoft1-Nov-05 3:16 
QuestionHow to convert textfile into variables and arrays? Pin
jedenddhsakjldf1-Nov-05 2:00
jedenddhsakjldf1-Nov-05 2:00 
QuestionRe: How to convert textfile into variables and arrays? Pin
David Crow1-Nov-05 2:25
David Crow1-Nov-05 2:25 

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.