User Profile

Collapse

Profile Sidebar

Collapse
dwurmfeld
dwurmfeld
Last Activity: Jan 5 '09, 02:48 PM
Joined: Mar 8 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dwurmfeld
    replied to difference between structure & union
    in C
    Sure, here is a piece of nonsense code, using a formal CoordinateClass would make more sense, but from the point of view of the argument, the union of structures doesn't much help "save space", indeed, if this were an embedded application, could you really trust the sizeof operator?


    Code:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc,
    ...
    See more | Go to post

    Leave a comment:


  • dwurmfeld
    replied to difference between structure & union
    in C
    .


    ....
    See more | Go to post

    Leave a comment:


  • dwurmfeld
    replied to plz help me..
    in C
    How about this for a start? Break up the problem into managable pieces, try to get a piece to run and ask questions of the group to specific problems. Looking at the assignment I would group the "pieces" as follows:

    decide on a data structure to keep the student information; name grade, average...

    and now, for each line in the file...
    read text from a file a line at a time
    is it the first line?...
    See more | Go to post

    Leave a comment:


  • dwurmfeld
    replied to difference between structure & union
    in C
    I guess most of the confusion comes when designers include unions as fields along with base types and structs in a new type definition. There seems to be no concern for the storage, just the convenience of hiding the details....
    See more | Go to post

    Leave a comment:


  • I would use the "string" class in C++, it has a powerful compare method:

    Here is an example of how it can be used: (from cplusplus.com)

    Code:
    // comparing apples with apples
    #include <iostream>
    #include <string>
    using namespace std;
    
    int main ()
    {
      string str1 ("green apple");
      string str2 ("red apple");
    ...
    See more | Go to post

    Leave a comment:


  • I will not solve it for you here, you need to learn how to use the many C++ references you have available. I looked up switch-case statement on Google using this query: " switch case statement +"C++" " and I got many pages of hits, most of which give a clear definition and usage for the switch-case statement.

    One of the references I found gives a good example:
    http://www.fredosaurus .com/notes-cpp/statements/switch.html...
    See more | Go to post

    Leave a comment:


  • dwurmfeld
    replied to Communicating to a serial device using Dev-C++
    in C
    Thanks, this is exactly the help I needed, I was not aware there were online Win32 API references. I have been in the embedded community for too long!

    David...
    See more | Go to post

    Leave a comment:


  • dwurmfeld
    started a topic Communicating to a serial device using Dev-C++
    in C

    Communicating to a serial device using Dev-C++

    I would like to play with an older GPS unit that has a serial interface. I am using XP and Dev-C++. I have some console based experience in C, but no windows experience to speak of. To remedy that, I would like to write a windows app that will simply monitor the output of the GPS, and send commands to the GPS interactively from a text box.

    My questions:
    Is Dev-C++ suitable to the task?
    Is the "win32" library...
    See more | Go to post

  • When you have to solve a programming problem, I find it helpful to list out in words what you are trying to do;
    • the answer is the sum of numbers 1 to 1000
    • except 300 and 500
    • somehow, either add the numbers individually
    • just do not add 300 and 500
    • or figure a loop that will increment the number to add to the answer
    • figure out a way to check in the loop if 300 or 500 has come up and do not add them to the answer


    So......
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...