Search:

Type: Posts; User: millsy5

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    821

    use ^ with non integers

    Is it possible to raise a non integer value to a power?

    e.g.

    num = 5.2 ^ 3
  2. Replies
    1
    Views
    11,127

    if statement with hex variable

    It is possible to use hex values with the if statement

    e.g.

    insert


    if (value == f)
    {
    ...
  3. Replies
    1
    Views
    10,085

    Concatenate string and int

    It is any way to concatenate a string and an integer? I want to add a loop iteration number to the end of a string. Something like 'strcat' would be handy but that only works with strings.

    I would...
  4. Replies
    3
    Views
    31,954

    How to return an array from a function

    I'm relatively new to C and I'm having trouble returning an array from a function. Apologies if this have been answered elsewhere but I can't find it. I read somewhere about returning the first...
  5. Replies
    2
    Views
    1,336

    density of 0s & 1s in an array

    Is there any tidy and efficient way of finding the density of 1s and 0s in an array of 1s and 0s?

    I have a window of 10 variables which I iterate across the array. I want to stop when the window...
  6. Thread: for loop

    by millsy5
    Replies
    3
    Views
    994

    cheers mate, i had simply put put in i+5 instead...

    cheers mate, i had simply put put in i+5 instead of i = i+5
  7. Thread: for loop

    by millsy5
    Replies
    3
    Views
    994

    for loop

    In a for loop i is incremented by i using i++

    eg. for(i=0;i<10<i++)

    Is there any way to increment by more than one other than:

    eg.
  8. Convert array of characters in file to integers

    I have a text file consisting of 0's and 1's. I want to read these characters into an array as integers and then save that array into another file.

    I'm using fread to read the data into the...
  9. Replies
    9
    Views
    4,528

    Thanks. How do I check which compiler I am using?

    Thanks. How do I check which compiler I am using?
  10. Replies
    9
    Views
    4,528

    My apologies, that was a typo. However the code...

    My apologies, that was a typo. However the code with the correct syntax is not working.

    double z = x/y;
    int a = (int) z;

    int array1[a];


    I'm still getting "integral constant expression...
  11. Replies
    9
    Views
    4,528

    I need to use the int value to declare the array...

    I need to use the int value to declare the array size. However when I try the suggested responses it does not work.

    It says "integral constant expression expected"


    double z = x/y;
    int a =...
  12. Replies
    9
    Views
    4,528

    Convert double to int for array size

    Hi,

    I want to declare an array size based on a double calculation. Rounding it up or down doesn't really matter. As the array size needs to be an integer, is there any way I can convert the double...
Results 1 to 12 of 12