Click here to Skip to main content
15,914,406 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: motherboard serial number in VC++ Pin
John M. Drescher6-Feb-06 4:39
John M. Drescher6-Feb-06 4:39 
GeneralRe: motherboard serial number in VC++ Pin
suchuhui8-Feb-06 14:41
suchuhui8-Feb-06 14:41 
GeneralRe: motherboard serial number in VC++ Pin
John M. Drescher6-Feb-06 4:42
John M. Drescher6-Feb-06 4:42 
GeneralRe: motherboard serial number in VC++ Pin
John M. Drescher6-Feb-06 4:47
John M. Drescher6-Feb-06 4:47 
GeneralRe: motherboard serial number in VC++ Pin
suchuhui5-Feb-06 19:26
suchuhui5-Feb-06 19:26 
GeneralRe: motherboard serial number in VC++ Pin
RomTibi6-Feb-06 7:59
RomTibi6-Feb-06 7:59 
QuestionRead char with X/Y axes? Pin
Lord Kixdemp5-Feb-06 6:32
Lord Kixdemp5-Feb-06 6:32 
AnswerRe: Read char with X/Y axes? Pin
PJ Arends5-Feb-06 11:35
professionalPJ Arends5-Feb-06 11:35 
read the lines one at a time until you get to the required line, then get the required character
#include <iostream>
#include <fstream>
#include <string>
 
using namespace std;
 
int main(int argc, char* argv[])
{
    int row = 0;
    int col = 0;
 
    do
    {
        cout << "Enter line number ";
        cin >> row;
        cout << "Enter column number ";
        cin >> col;
 
        if (row < 1 || col < 1)
            return 0;
 
        ifstream ifs(argv[1]);
 
        string str;
        int x = 1;
        for (x = 1; x <= row && !ifs.eof(); ++x)
            ifs >> str;
 
        if (ifs.eof())
            cout << "Invalid line" << endl;
        else if (col > str.length())
            cout << "Invalid column" << endl;
        else
            cout << str.c_str()[col - 1] << endl;
        ifs.close();
    } while (1);
}





"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

"Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04

"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05

Within you lies the power for good - Use it!
GeneralRe: Read char with X/Y axes? Pin
Lord Kixdemp5-Feb-06 12:51
Lord Kixdemp5-Feb-06 12:51 
GeneralRe: Read char with X/Y axes? Pin
PJ Arends5-Feb-06 13:23
professionalPJ Arends5-Feb-06 13:23 
GeneralRe: Read char with X/Y axes? Pin
Lord Kixdemp5-Feb-06 16:30
Lord Kixdemp5-Feb-06 16:30 
GeneralRe: Read char with X/Y axes? Pin
Lord Kixdemp8-Feb-06 10:55
Lord Kixdemp8-Feb-06 10:55 
QuestionApplication hangs when interrupted Pin
Joel McAlduff5-Feb-06 5:46
Joel McAlduff5-Feb-06 5:46 
AnswerMessage Closed Pin
5-Feb-06 8:44
ddmcr5-Feb-06 8:44 
GeneralRe: Application hangs when interrupted Pin
Joel McAlduff5-Feb-06 8:56
Joel McAlduff5-Feb-06 8:56 
QuestionRetrieving data from an ODBC data source Pin
SWDevil5-Feb-06 4:26
SWDevil5-Feb-06 4:26 
AnswerRe: Retrieving data from an ODBC data source Pin
Joel McAlduff5-Feb-06 4:44
Joel McAlduff5-Feb-06 4:44 
GeneralRe: Retrieving data from an ODBC data source Pin
SWDevil5-Feb-06 4:52
SWDevil5-Feb-06 4:52 
GeneralRe: Retrieving data from an ODBC data source Pin
Joel McAlduff5-Feb-06 5:22
Joel McAlduff5-Feb-06 5:22 
GeneralRe: Retrieving data from an ODBC data source Pin
SWDevil5-Feb-06 20:55
SWDevil5-Feb-06 20:55 
AnswerRe: Retrieving data from an ODBC data source Pin
David Crow7-Feb-06 2:54
David Crow7-Feb-06 2:54 
GeneralRe: Retrieving data from an ODBC data source Pin
SWDevil7-Feb-06 5:25
SWDevil7-Feb-06 5:25 
GeneralRe: Retrieving data from an ODBC data source Pin
David Crow7-Feb-06 5:34
David Crow7-Feb-06 5:34 
QuestionVisual Studio 2005 Standard - MFC? Pin
Dominik Reichl5-Feb-06 2:08
Dominik Reichl5-Feb-06 2:08 
AnswerRe: Visual Studio 2005 Standard - MFC? Pin
Jack Puppy5-Feb-06 3:21
Jack Puppy5-Feb-06 3:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.