CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: karnavor

Page 1 of 3 1 2 3

Search: Search took 0.04 seconds.

  1. Replies
    11
    Views
    1,657

    Re: C++ Inheritance

    Thanks, I'll look into all this!
  2. Replies
    11
    Views
    1,657

    Re: C++ Inheritance

    Thanks, I think I understand this now. So storing a vector of pointers will retain the derived object, rather than slicing it to the base object, which enables me to call the derived function via the...
  3. Replies
    11
    Views
    1,657

    Re: C++ Inheritance

    Hi,

    Thanks for the responses. The reason I am writing this code is that I am writing a GUI, which has a set of buttons. But there are several different types of buttons. So, I have a "Button"...
  4. Replies
    11
    Views
    1,657

    C++ Inheritance

    Hello,

    I have a simple question about inheritance. Consider the following code:




    Class Base
    {
    int type;
  5. Replies
    0
    Views
    491

    Creating New Database Table

    Hello,

    I am very new to database with C#, so hopefully this will just be a quick one.

    I'm trying to create a new SQL database with Visual Studio 2013, with one table. I am following a tutorial,...
  6. Visual Studio Debugging - revisiting same memory state

    Hello,

    When running my code in Visual Studio, there is a particular point in the code where my program is crashing. To debug this, I am adding a break point in Debug mode just before that point,...
  7. Replies
    1
    Views
    1,223

    vector::assign in two dimensions

    Hello,

    If I have a one-dimensional array of length 10, vector<int> x, and I want to assign all the elements to value 5, then I can do the following:



    vector<int> x(10);
    x.assign(10, 5);
  8. Replies
    1
    Views
    616

    When to use static classes

    Hello,

    I am just wondering what the best practice is for when to use static classes (by static class, I mean a class which has only static attributes and functions).

    If you are creating more...
  9. Replies
    10
    Views
    2,304

    General Object-Orientated Question

    Hello,

    I have a very general question about object-orientation programming. I have been programming for a few years, but I'm just wondering what the best practice is for this particular situation....
  10. Renaming Visual Studio Project/Solution Files

    Hello,

    I have a Visual Studio 10 Project, and I want to rename both the Project, and the Solution. To do this so far, I have right-clicked on the Project or Solution in the Solution Explorer, then...
  11. Replies
    3
    Views
    3,574

    fstream - Writing in the middle of a file

    Hello,

    I want to edit the contents of a file using fstream, but none of the modes in the fstream constructor work for me.

    If I use ios::trunc, then the whole file is deleted - but I want to...
  12. Replies
    0
    Views
    651

    Adding GPS data to JPEG file

    Hello,

    This is not strictly a C++ question, but I don't know where else to ask!

    Anyway, I am writing a program to read and write EXIF data in a JPEG file; specifically, the GPS data.

    I have...
  13. Replies
    2
    Views
    11,962

    OpenCV solve equation

    Hello,

    I'm hoping that there is somebody out there who is familiar with OpenCV, as I have a very simple problem.

    I have a linear equation Ax = B which I want to solve. This is done with the...
  14. Replies
    2
    Views
    847

    Linking to DLLs with Visual Studio 10

    Hello,

    I have a library that I want to link to with Visual Studio 10. It is a dynamic-link library, with a .dll file and a .lib file. I am following what I think is the correct procedure for...
  15. Replies
    3
    Views
    953

    Compiling from source

    Hello,

    I have a fairly basic question about compiling libraries. Suppose that I want to use an open-source library that has been written by somebody else. Typically, when I go to the website to...
  16. Thread: ios::trunc

    by karnavor
    Replies
    8
    Views
    12,338

    Re: ios::trunc

    But is it possible to write the vector.size() value at the beginning of the file, after I've written the rest of the file?
  17. Thread: ios::trunc

    by karnavor
    Replies
    8
    Views
    12,338

    Re: ios::trunc

    The reason I need that piece of code is because I need to read the last entry in the data file, before I read the rest of the file. When creating the file, I am adding numbers from an array to the...
  18. Thread: ios::trunc

    by karnavor
    Replies
    8
    Views
    12,338

    Re: ios::trunc

    Hi,

    Thanks for your help. Losing the ios::app worked!

    However, I have also come across something else peculiar.

    If I use:


    in.seekg(-(sizeof(int)), ios::end);
  19. Thread: ios::trunc

    by karnavor
    Replies
    8
    Views
    12,338

    ios::trunc

    Hello,

    I am saving data to a file "myfile.dat". Every time I save new data, I want to eliminate the existing file and start a new file. From what I know, setting the ios::trunc flag should do...
  20. Replies
    4
    Views
    2,304

    Re: GNU Scientific Library eigenvectors

    Hi, thanks for your reply. The Wikipedia article states that:

    "the Perron–Frobenius theorem ... asserts that a real square matrix with positive entries has a unique largest real eigenvalue and...
  21. Replies
    4
    Views
    2,304

    GNU Scientific Library eigenvectors

    Hello,

    I am trying to use the GNU Scientific Library (GSL) to compute the leading eigenvector (corresponding to the largest eigenvalue) of a matrix M of size N (N ~ 100). M is square and...
  22. Replies
    1
    Views
    709

    Clearing std::cin buffer?

    Hello,

    I am using a computer vision C++ library called OpenCV, which has a function "int waitKey(int delay)". This function waits for a user input key, for a specified number of milliseconds. It...
  23. Replies
    4
    Views
    1,668

    Programming Windows API in Mac OS Bootcamp

    Hello,

    I am running Windows 7 on a Mac, using Apple's Bootcamp utility, such that the Windows installation is native. However, I am finding some issues when programming the Windows API using...
  24. Thread: Header files

    by karnavor
    Replies
    2
    Views
    608

    Header files

    Hello,

    What is the difference between the header files <header.h> and <header>?

    I know that the <...> brackets indicate that the header file is located in some standard directory that the...
  25. Replies
    2
    Views
    7,109

    ifstream / ofstream precision

    Hello,

    I'd like to ask two different questions on a related topic please...

    1. When I am writing float data to a text file, I want to set the precision. I know that with std::cout, you can...
Results 1 to 25 of 68
Page 1 of 3 1 2 3





Click Here to Expand Forum to Full Width

Featured