Search:

Type: Posts; User: Loctan

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    923

    "val" is just a pointer to some variable that we...

    "val" is just a pointer to some variable that we either populate with "source" if it's valid or populate with "default" if "source" is not valid. The variable pointed to by "val" is sometimes a float...
  2. Replies
    3
    Views
    923

    Can anyone sol ve this casting issue?

    We have a structure defined something like (it does a lot more than this, but this is all that's necessary for my problem):




    typdef struct
    {

    some_data_type source;
  3. Thread: C casting

    by Loctan
    Replies
    5
    Views
    1,525

    C casting

    Can anyone tell me the difference between:




    float answer = 3.0f;
  4. Replies
    18
    Views
    2,902

    I did a search and someone posted a very similar...

    I did a search and someone posted a very similar question on Daniweb last April. It most definitely is HW.
  5. #include int main() { int...

    #include <iostream>



    int main()
    {
    int num = 0x1111;

    for(int i = sizeof(int)*8-1; i >= 0; i--)
    {
  6. Replies
    16
    Views
    7,213

    Thanks for the explanations guys. I have never...

    Thanks for the explanations guys. I have never had the opportunity to take a compiler course so I wasn't sure of all the details of this. Hopefully I can take one soon. For fun, if I get bored at...
  7. Thread: Pointer error

    by Loctan
    Replies
    8
    Views
    1,793

    int * pointer = (int*)0x100579C; //ERROR ZONE

    int * pointer = (int*)0x100579C; //ERROR ZONE
  8. Thread: Pointer error

    by Loctan
    Replies
    8
    Views
    1,793

    "0x100579C" is an integer. You need to cast it as...

    "0x100579C" is an integer. You need to cast it as a pointer to an integer. e.g, (int*)
  9. Replies
    16
    Views
    7,213

    Header file multiple inclusion question

    I understand about the whole

    Blah.h



    ifndef BLAH_H
    #define BLAH_H
  10. Replies
    8
    Views
    1,355

    Please format your code and post what your...

    Please format your code and post what your program does along with the errors.

    [edit] After pasting your code in Dev C++ I think you will see many of your errors. Your braces are out of place.
  11. Replies
    39
    Views
    5,538

    I would like to help you, but you indentation...

    I would like to help you, but you indentation stinks. Your code is barely readable. Instead of this:



    while((d1!=0)||(d1=a1)||(d1=b1)||(d1=c1)){
    d1=rand()*5/32768;
    if...
  12. Replies
    6
    Views
    22,967

    I am not sure there are necessarily hard and fast...

    I am not sure there are necessarily hard and fast rules for this, so this is more than opinion (to a large extent). Consider this hypothetical program. Suppose you have an address book and want to...
  13. Replies
    6
    Views
    22,967

    A binary search tree will provide logarithmic...

    A binary search tree will provide logarithmic searching which is pretty good. Insertions or deletions will be more costly because they may require some tree rebalancing.

    For your linked list, are...
  14. Replies
    3
    Views
    1,052

    I really didn't check the logic, but it compiles...

    I really didn't check the logic, but it compiles and runs if you get rid of:



    int v;


    You don't use it. v is already declared as a vector.

    You need to include the vector header since you...
  15. Sweet. Thank you very much.

    Sweet. Thank you very much.
  16. How can I use a string stream to do multiple conversions?

    I want to use a string stream to convert an int to a string, then a string to an int use the same stringstream. If I declare two like this, it works fine:



    #include <iostream>
    #include...
  17. Replies
    5
    Views
    1,222

    Thanks for the help.

    Thanks for the help.
  18. Replies
    11
    Views
    2,653

    Nice work. I have done some work with AutoCAD and...

    Nice work. I have done some work with AutoCAD and Mechanical Desktop. Making the individual parts usually isn't too bad, but piecing it together can be quite difficult.
  19. Thread: Images

    by Loctan
    Replies
    3
    Views
    1,127

    I think this is what you are looking for. In...

    I think this is what you are looking for. In particular lesson 13.

    http://www.functionx.com/win32/index.htm
  20. Replies
    5
    Views
    1,222

    Understanding C++ Online References

    That may be a poorly worded title, but this is what I am confused about. The only online reference I use for C++ is this website:

    http://www.cppreference.com/

    When I look functions up, it...
  21. Replies
    10
    Views
    28,504

    After looking through it, you need to start over...

    After looking through it, you need to start over IMO. You are using goto statements, have random braces and this isn't even C++. It's C.

    I will be up late tonight so if you want to post your...
  22. Replies
    10
    Views
    28,504

    I pasted your code and it doesn't even compile.

    I pasted your code and it doesn't even compile.
  23. Replies
    2
    Views
    1,366

    Can't you use getline to get the string and then...

    Can't you use getline to get the string and then just access the first two characters by saying:




    stringName.substr(2);

    http://www.cppreference.com/cppstring/substr.html
  24. Thread: Hello and Help

    by Loctan
    Replies
    16
    Views
    1,828

    You can test it yourself by downloading Dev C++....

    You can test it yourself by downloading Dev C++. you don't have to be in your lab.



    transform(answer.begin(), answer.end(), answer.begin(), ::tolower);

    Converts the string from uppcase to...
  25. Thread: Hello and Help

    by Loctan
    Replies
    16
    Views
    1,828

    If I were you, I wouldn't worry about using...

    If I were you, I wouldn't worry about using pointers to character arrays. I would just use strings.

    Someone posted this here awhile ago and I think it might help you:


    // An improved version...
Results 1 to 25 of 84
Page 1 of 4 1 2 3 4