Search:

Type: Posts; User: azsquall

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    10
    Views
    1,682

    I see, so "atol" doesn't get a single character. ...

    I see, so "atol" doesn't get a single character.

    yes, i was trying to get around "char to int" conversion error, and you brought up "atol" so i tried out and got the error above.

    Thanks!!
  2. Replies
    10
    Views
    1,682

    based on my main() int main(int arc, char...

    based on my main()

    int main(int arc, char *arv[])

    arv[] is char pointer. I'd like to passed something like


    command.exe 5 filename.txt
  3. Replies
    10
    Views
    1,682

    yeah. I tried that but the compiler won't let me...

    yeah. I tried that but the compiler won't let me

    atol: cannot convert parameter 1 from char` to `const car`
  4. Replies
    10
    Views
    1,682

    thanks! actually, i ran into problem char*...

    thanks!
    actually, i ran into problem

    char* argv[]
    that is an array of characters. yet, i need to get com port and baud rate, which has been declared as INT16. Is there any way to get around...
  5. Replies
    10
    Views
    1,682

    nice!!! thanks!! I solved the problem!

    nice!!!
    thanks!! I solved the problem!
  6. Replies
    10
    Views
    1,682

    command/program options

    Hi,
    I have a c++ program that handles serial communications. At this stage, serial settings (ports, baud rate, settings) are hard-coded into the program.

    I'd like to re-build the program so that...
  7. Replies
    10
    Views
    2,951

    hi guys my bad...how come i didn't see that......

    hi guys
    my bad...how come i didn't see that... ;)
    it's working..it's my printArray function that prints out out-of-bound element...

    thanks again!!!
  8. Replies
    10
    Views
    2,951

    1+rand()%6 should give out number from 1 to 6...

    1+rand()%6 should give out number from 1 to 6 right?
    in my case, i got all weird number like -123655390
  9. Replies
    10
    Views
    2,951

    Ahh! I see. I totally forgot about that.....

    Ahh! I see. I totally forgot about that..
    row=col=6 .. it's a 6x6 array and i tried to generate random number from 1 to 6 with 1 + rand() %6
  10. Replies
    10
    Views
    2,951

    i though the nested for-loop will loop through...

    i though the nested for-loop will loop through each element?
  11. Replies
    10
    Views
    2,951

    I had tried that, but the output elements still...

    I had tried that, but the output elements still remains the same.
    It should be different for each of the element; however, in this case, they're the same.

    am I missing anything?
    thanks!
  12. Replies
    10
    Views
    2,951

    fill array with random number

    Hi,
    I've been trying to fill an 6x6 array with random number from 1 to 6,
    this is my function that takes care of this


    void initArray(int arrayName[][col], int row, int col)
    {

    for (int i...
  13. Replies
    15
    Views
    11,520

    You see the output? How can I output the...

    You see the output?
    How can I output the array's elements. Each element should be only read ONCE?
    That's why I need the "check neighbor" function so that will ignore the repeated elements and...
  14. Replies
    15
    Views
    11,520

    The reason i do the sort because I want to...

    The reason i do the sort because I want to generate the ouput like this:
    INPUT: 5 5 5 4 3 2 8 9 3


    number count
    2 2
    3 2
    4 1
    5 ...
  15. Replies
    15
    Views
    11,520

    I used bubble sort as it's the only I know so...

    I used bubble sort as it's the only I know so far.
    I counted frequency of elements of 1 array by using another array for counter.
    is there any way different than that?
  16. Replies
    15
    Views
    11,520

    :) that's why I have to sort the input array...

    :)
    that's why I have to sort the input array first.
    say you input: 3 1 3 35 4 5 3 34
    after sorting: 1 3 3 3 4 5 34 35
    Then I have do the check neighbor correct?
    Is there any way smarter than...
  17. Replies
    15
    Views
    11,520

    Thanks!! I had tried that. But it has 1 fall...

    Thanks!! I had tried that.
    But it has 1 fall back.



    countingArraySize=20
    sourceArraySize=20

    and if, somehow, we randomly input 4 5 4 3 2 32
    then countingArray[ sourceArray[i] ]++ will be...
  18. Replies
    15
    Views
    11,520

    sorry for the confusing!! the problem is to read...

    sorry for the confusing!!
    the problem is to read a set of positive integer and output how many time a particular number appears. Assume that the maximum you can enter is 100 numbers.
    For example...
  19. Replies
    15
    Views
    11,520

    count/display non-repeated element of array

    hi guys
    I'm working of self-study project that needs to count how many an element of an array is repeated. And print out result.
    I've been asking myself whether there is a smarter way doing this....
  20. Replies
    10
    Views
    18,084

    thanks!!! can you please abit more specific?

    thanks!!!
    can you please abit more specific?
  21. Replies
    10
    Views
    18,084

    thanks! i'd like to have the out to be 1 2 3...

    thanks!
    i'd like to have the out to be
    1
    2
    3
    4
    5
    6
    7
    ......
  22. Replies
    10
    Views
    18,084

    flag-controlled while loop

    hi,
    i have quite big program, with respect to my beginning skill, that contains a while loop. This loop, or the program itself, can only be terminated by pressing Ctrl-C.

    I'd like to change that...
  23. Replies
    88
    Views
    11,066

    I got the same result H T T T T H H H H T T T...

    I got the same result
    H T T T T H H H H
    T T T H H H H H H
    ......

    and the same count for each H and T for every execution...
    perhaps, I should use "srand"
  24. Replies
    88
    Views
    11,066

    random isn't really random?

    hi,
    Just a quick question. I wrote a short code for generating 0, 1 randomly in order to simulate a coin-tossing game.


    //This program will simulate 100 times
    //of coin-tossings. Then it will...
  25. Replies
    9
    Views
    1,509

    hey thanks!! I got it now!

    hey thanks!!
    I got it now!
Results 1 to 25 of 43
Page 1 of 2 1 2