Search:

Type: Posts; User: kulfon

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,011

    Visual Studio 2010 Professional and I am just...

    Visual Studio 2010 Professional
    and I am just using notepad to view the file
  2. Replies
    5
    Views
    1,011

    Output to file produces crap

    This is driving me crazy, I have the following program:

    #include <iostream>
    #include <fstream>
    #include <cstdlib>
    using namespace std;

    int main()
    {
    ofstream myfile;
  3. Using , compiles in Visual Studio, massive errors in g++

    Hi

    I wrote some classes inheriting from <exception> in the following way:

    class NoFile : public exception
    {
    public:
    NoFile();
    NoFile(string);
    NoFile(const NoFile &);
  4. Replies
    2
    Views
    1,645

    Sorry for double posting but I kind of figured...

    Sorry for double posting but I kind of figured out that the error was due to nothing being returned from the catch block, and in the main function nothing was to be assigned to the test2 vector. I...
  5. Replies
    2
    Views
    1,645

    Access violation error

    I am trying to write a getter function from my class, which would return a part of my member variable vector<short>:

    const vector<short> Input::getOneRow(int index) const
    {
    try
    {
    return...
  6. Replies
    1
    Views
    863

    Virtual functions, confusion

    I am trying to understand the sense of virtual fuctions and so I wrote the following piece of code:

    #include <iostream>
    using namespace std;

    class Base
    {
    public:
    virtual void doit() { cout...
  7. Replies
    3
    Views
    14,610

    [VS2010] adding *.dll files to a project

    I am writing a C++ application in Visual Studio 2010 which is meant to use MATLAB for graph plotting. In order to do so I added the MATLAB dll directory in my solution:
    Properties -> Debugging ->...
  8. Thread: Complex input

    by kulfon
    Replies
    4
    Views
    1,277

    Complex input

    Hi, I am writing a program to perform nodal analysis and I need complex input for phasors and impedances. I have declared the variable and I want to read its value from standard input:

    complex...
  9. Replies
    2
    Views
    3,669

    Annoying getline does not work

    This is an extract from a much bigger program:

    #include <fstream>
    #include <iostream>
    #include <string>
    using namespace std;

    int main()
    {
    ifstream input;
  10. Replies
    3
    Views
    6,860

    Why first getline doesnt work?

    I have written a program, which is supposed to read 3 lines from a text file, the first is char, second string and thirs an integer. The input.txt is:

    i
    Arnold Schwarzenegger
    60

    And my code:...
  11. So how do I make it work? I do not want it to...

    So how do I make it work? I do not want it to iterate through one of the switch statements twice after grabbing the last instruction from the file. Should I add another while(command.eof() == false)...
  12. Why the eof returns false when it should return true?

    I have written this piece of code:

    if(command.is_open() == true)
    {
    while(command.eof() == false)
    {
    command >> instr;
    switch(instr)
    {
    case 'r':
  13. Could you explain what this second usage of...

    Could you explain what this second usage of 'buffer' is supposed to do?
    I mean while(temp=buffer.get()), buffer)

    Because, before you edited the post I used (completely randomly, without knowledge...
  14. how to make stringstream take in spaces as input?

    int main()
    {
    string input = "abc def";
    stringstream buffer(input);
    char temp;
    int i = 0;
    char something[20];

    while(buffer >> temp)
    {
  15. Replies
    10
    Views
    4,167

    fgets will read only one line of the file, what...

    fgets will read only one line of the file, what if there is more and i still want them all in one string?

    And that code below works, is that what you tried to tell me to fix?


    #include...
  16. Replies
    10
    Views
    4,167

    This is a typo, ofcourse it should be 1.

    This is a typo, ofcourse it should be 1.
  17. Replies
    10
    Views
    4,167

    Okay, I get that but how to find out in which...

    Okay, I get that but how to find out in which place of my buffer array I need to put the null terminator?
  18. Replies
    10
    Views
    4,167

    fread creates a string with crap at the end

    I want to read a whole text file a once into a single string. I have used the fread() function in the following way:

    #include <stdio.h>

    int main()
    {
    FILE *fInp;
    char buffer[1000];

    fInp...
  19. Replies
    2
    Views
    2,164

    Passing array into function

    I am trying to write a program that will compute an angle and magnitude of a given complex number. I have therefore declared an array of 2 floats in which [0] stores the real part and [1] the...
Results 1 to 19 of 19