Search:

Type: Posts; User: kurz7

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,539

    show us the errors at least we can't even tell...

    show us the errors at least

    we can't even tell whats in those header files you included.
  2. have you even tried it yet? its very simple. ...

    have you even tried it yet?
    its very simple.

    give it a go first
  3. lol what were your previous 47 questions?...

    lol

    what were your previous 47 questions? Learning how to write helloworld in 47 different languages?

    If you have done those 47 then this should be a catwalk.


    1. if n =1, j=5;

    while(n<j)
  4. Replies
    5
    Views
    3,391

    dont forget to compile with the -lm

    dont forget to compile with the -lm
  5. Thread: nested switch

    by kurz7
    Replies
    1
    Views
    2,835

    nested switch

    Can you have nested switch statements? Will this be just as efficient as IF-Else statements? It sure does look alot neater.

    Cheers!

    e.g


    switch(a)
    {
    case 1:
  6. Replies
    3
    Views
    3,435

    try using strcmp(member1->data,member2->data) and...

    try using strcmp(member1->data,member2->data) and then perhaps swapping them.

    i would use strcmp, but maybe there are other ways.
  7. Replies
    3
    Views
    854

    hmm clever. Dont have to think about ungetc()...

    hmm clever.

    Dont have to think about ungetc() now.

    Thanks Salem
  8. Replies
    3
    Views
    854

    >> what i want to do is just peek at the next...

    >> what i want to do is just peek at the next character thats it but if use getchar() then it doesnt work because the character i peek at doesnt return

    isnt ungetc() used for files though?
    ...
  9. Replies
    3
    Views
    854

    regetting characters

    Hi Guys.

    When i use a while loop to scan in characters for instance


    while ( (ch=getchar()) != EOF ) {
    if ( ch == '\n' ) {
    do this;
    if ( (ch=getchar()) == '\n' ) {
    do that;
  10. Replies
    1
    Views
    1,174

    nonpolymorphic to polymorphic

    Hi guys.
    Below ive written a foldl program which calculates the values in the array with the function add with values in the array from left to right. This is the non-polymorphic function with...
  11. Replies
    2
    Views
    1,668

    =( forgot about strcmp damnit thanks...

    =(

    forgot about strcmp

    damnit

    thanks guys!
  12. Replies
    2
    Views
    1,668

    matching strings at end

    Hi guys,
    Anyone see whats wrong here?
    What im trying to do is input two strings say s and t.
    Return true if the string s is at the end of string t.
    My function just keeps return true.

    cheers!
  13. Replies
    8
    Views
    1,914

    sorry when you say unique, the same generated...

    sorry

    when you say unique, the same generated random number cannot appear again?
  14. Thread: shifting numbers

    by kurz7
    Replies
    1
    Views
    1,350

    shifting numbers

    is there a certain algorithm to do a rotation/shift of an integer x to say n positions right?

    rot(x,n)
    for example...rot(1234,2)
    this would be 3412...

    what i tried to do was input the number,...
  15. Replies
    8
    Views
    1,914

    if you perform the shuffle below, when u exchange...

    if you perform the shuffle below, when u exchange the random numbers how will it know that it is not already in the array or not already generated?
    i.e. a duplicate occuring

    how can the shuffle...
  16. Replies
    8
    Views
    1,914

    cheers dave

    cheers dave
  17. Replies
    8
    Views
    1,914

    the goto is hard to digest. but the if...

    the goto is hard to digest.
    but the if statements and what to do next are just as annoying.
    im stuck with the conditions.
  18. Replies
    8
    Views
    1,914

    hmm ive tried placing the tmp array outside of...

    hmm ive tried placing the tmp array outside of that for loop so that i allow it to scan the whole array for a match.

    however if it breaks out of that loop then it will add the value to the tmp...
  19. Replies
    8
    Views
    1,914

    help with generating numbers

    Hi guys,
    Im trying to implement a function/program that generates numbers from 1 to the input number given by the user. I've come close to generating all the numbers however there are some...
  20. Thread: IF problems

    by kurz7
    Replies
    6
    Views
    1,025

    just like quzah said. you need to use strcmp...

    just like quzah said.

    you need to use strcmp from the <string.h> library to compare strings.

    if strcmp returns 0 then they are a match
    if strcmp returns 1 then first arg greater then second...
  21. Replies
    6
    Views
    17,448

    to find out if the array is full of zeroes you...

    to find out if the array is full of zeroes you could loop through the array and create a flag.
    initialise this flag to false to begin with and the go through the array and see if the value is zero....
  22. Replies
    6
    Views
    17,448

    no you can use the strcmp from the ...

    no you can use the strcmp from the <string.h> library.

    so if strcmp( array1, array2 ) == 0
    then they are equal
    if strcmp( array1, array2 ) == 1
    then array1 is bigger then array2
    if strcmp(...
  23. Replies
    7
    Views
    2,525

    i dont think anyones going to do your...

    i dont think anyones going to do your assignment/homework for you. why dont you give it a try first then we can help
  24. Replies
    8
    Views
    6,071

    hmm so the moment i enter a decimal number its...

    hmm so the moment i enter a decimal number its converted to binary already?

    so then just use bitwise operaters and compare and print out the values?

    is that the logic here?
  25. Replies
    8
    Views
    6,071

    thanks guys for the replies. but just unsure...

    thanks guys for the replies.

    but just unsure how a number gets converted to binary
    for example the decimal number is 20 which is 010100 in binary. How does the bitwise recognise the decimal...
Results 1 to 25 of 116
Page 1 of 5 1 2 3 4