Search:

Type: Posts; User: DrZoidberg

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    4,434

    ^ You didn't pay attention in physics class...

    ^

    You didn't pay attention in physics class right?
    You can't produce a blinding light with the energy of a blink. That's like powering a 2000W searchlight with a button cell battery.
    So there is...
  2. Replies
    14
    Views
    3,408

    :D :D :p

    :D :D :p
  3. Replies
    10
    Views
    2,478

    I fixed the error. This program can search for...

    I fixed the error. This program can search for any string, not just ei.



    #include <stdio.h>
    #include <stdlib.h>

    int main(void){
    char c;
    char searchstr[]="ei";
  4. Replies
    13
    Views
    3,261

    Nice. Can you explain how it works?

    Nice. Can you explain how it works?
  5. Replies
    13
    Views
    3,261

    In C it would look like this: void...

    In C it would look like this:



    void lines(int rows) {
    for(i=0; i<rows; i++) {
    for(j=0; j<rows-i-1; j++) printf(" ");
    for(k=0; k<i*2+1; k++) printf("*");
    ...
  6. Replies
    10
    Views
    2,478

    Re: Re: Very proud of this code.

    #include <stdio.h>
    #include <stdlib.h>


    int main(void){

    char c;

    do {
    if ((c = getchar()) == 'e'){
  7. I don't believe that there can be NULL bytes in...

    I don't believe that there can be NULL bytes in an email but if there really are just replace them with some non-ascii byte before processing.
    Every byte with a value of more then 127 is not an...
  8. Replies
    3
    Views
    1,030

    I made a few corrections. #include...

    I made a few corrections.



    #include <stdio.h>

    int main()
    {
    int times_tables, correct_answer,user_answer;
    int counter;
  9. Replies
    16
    Views
    4,433

    Hi, my name is Roy, I am a magic addict. ...

    Hi, my name is Roy, I am a magic addict.

    Translated with babel.altavista.com
    English -> Japanese -> English

    Today, as for my name Roy, it is the common practice person of the magic which is I...
  10. Thread: Temperature

    by DrZoidberg
    Replies
    5
    Views
    1,469

    There was something missing. printf ("The...

    There was something missing.
    printf ("The Temperature in Celsius is %d\n\n",cel);

    Also it is spelled Fahrenheit.
  11. Thread: Learning..?

    by DrZoidberg
    Replies
    3
    Views
    1,674

    Java has much in common with C and C++. If you...

    Java has much in common with C and C++. If you learn Java first it will be easier to learn C and C++ afterwards. And since you will learn java at your Uni this year anyway it might be best to just...
  12. Replies
    5
    Views
    1,226

    You can use fopen to open a file and fgets to...

    You can use fopen to open a file and fgets to read a specific number of characters from the file.

    char buffer[100];
    FILE f = fopen("filename","r");
    fgets(buffer, 100, f);

    btw. characters are...
  13. Thread: pointers

    by DrZoidberg
    Replies
    6
    Views
    1,235

    Also your code is identical to mine except that...

    Also your code is identical to mine except that you didn't forget the linefeeds.
  14. #include #include int...

    #include <stdio.h>
    #include <stdlib.h>

    int sum(int x[],int length)
    {
    int sum=0;
    int i;
    for (i=0; i<length; i++)
    sum+=x[i];
    return sum;
  15. Thread: pointers

    by DrZoidberg
    Replies
    6
    Views
    1,235

    You can move an int variable with >> and

    You can move an int variable with >> and << but that will not give you the desired effect since an int variable is a binary number but you want to shift the decimal representation of that number.
    ...
  16. Thread: gcc

    by DrZoidberg
    Replies
    21
    Views
    6,140

    Why do want to invoke a c++ compilation with gcc?...

    Why do want to invoke a c++ compilation with gcc?
    gcc.exe is not the compiler. It's just a wrapper application that calls the compiler.
    If you want to use the c++ compiler start it with g++.exe.
  17. Thread: gcc

    by DrZoidberg
    Replies
    21
    Views
    6,140

    gcc invokes the c compiler by default. g++...

    gcc invokes the c compiler by default.
    g++ invokes the c++ compiler.

    So you have to type "g++ <source>" and not "gcc <source>" .

    Also the ANSI C++ Standard says it should be #include...
  18. Thread: array

    by DrZoidberg
    Replies
    1
    Views
    817

    int i; for(i=0, sum=0; i

    int i;
    for(i=0, sum=0; i<5; i++) {
    sum+=num_array[i];
    }

    for(i=0, sum=0; i<5; i++) {
    sum+=num_array[sizeof(num_array)/sizeof(num_array[0]) - i - 1];
    }

    for(i=0, sum=0; i <...
  19. Replies
    10
    Views
    1,091

    What kind of euations? You can limit it to...

    What kind of euations?
    You can limit it to simple equations that contains no brackets and only +,-,*,/.
    That should not be very difficult.

    Try this code. But it can only process simple...
  20. Replies
    13
    Views
    2,925

    No. That is not a hoax. That experiment was...

    No. That is not a hoax.
    That experiment was already performed in the 1970's by Professor Robert White, from Cleveland Ohio.
    It was on many news broadcasts and newspapers a few years ago because the...
  21. Replies
    13
    Views
    2,925

    If the brain was not damaged I really don't see...

    If the brain was not damaged I really don't see why the baboon should have lost it's memory. The memory resides inside the brain and not in any other body parts.
  22. int GetNrOfDigits(int Number) { int Digits =...

    int GetNrOfDigits(int Number)
    {
    int Digits = 0;
    do {
    Digits++;
    Number /= 10;
    } while(Number > 0);
    return Digits;
    }
  23. Thread: Help!!!

    by DrZoidberg
    Replies
    13
    Views
    1,811

    Re: Help!!!

    You wrote in your first post:


    But now you want a complete code for the first question.

    You don't need to output the spaces on the right side of the tiangle since they are not visible anyway.
  24. Thread: Help!!!

    by DrZoidberg
    Replies
    13
    Views
    1,811

    int i,j; int height=5; for(i=0; i

    int i,j;
    int height=5;

    for(i=0; i<height; i++)
    {
    for(j=0; j<...; j++)
    printf(" ");

    for(j=0; j<...; j++)
    printf("*");
  25. Thread: Help!!!

    by DrZoidberg
    Replies
    13
    Views
    1,811

    @buba: What are you calculating there? The...

    @buba:
    What are you calculating there?
    The distance between x and y would be abs(x-y).
    Also I don't see what that has to do with calculating pi.
Results 1 to 25 of 49
Page 1 of 2 1 2