Thursday, July 30, 2009

How do I check data from a file in c++ using dev?

I am writing a program in c++ and I would like to compare the data(words ) which are in a file to the data within an array. I would like to ask I could do it. please help me I am learning C++ and all my reseach didn't give me a satisfying result. thanks

How do I check data from a file in c++ using dev?
Consider using a stl::map or equivalent. You read in a word from the file and then check to see if the map has the word.





Also, consider joining a YahooGroup that specializes in C/C++ programming. Answers is not a good place to learn to program and you'll get the benefits of being part of a community with shared interests and goals.


What is a command for getting a hard copy in C using graphics.i.e; DOS mode C?

I have made a project to making to find the bill of a hotel in DOS mode C. I want to add a option to get a hardcopy of a bill. please tell me about the commond and its syntax in brief ?

What is a command for getting a hard copy in C using graphics.i.e; DOS mode C?
DOS mode only supports printing to a Parallel Printer (LPTx).





Try using the fprintf with the stream as "prn" (without quotes). See the online Turbo C++ 3.0 Documentation for the prn stream. It should provide output to a printer.





Again you can use:


biosprint


I am not sure if it works in 32 bit Windows.





FAQ:





biosprint and _bios_print %26lt;BIOS.H%26gt;








Printer I/O using BIOS services directly.





Declaration:


■ int biosprint(int cmd, int abyte, int port);


■ unsigned _bios_printer(int cmd, int port, int abyte);





Remarks:


Both biosprint and _bios_printer use BIOS interrupt 0x17 to perform various


printer functions on the printer identified by port.





Arg. │ What It Is





abyte │ The character to be printed; its value can be 0 to 255.





cmd │ Specifies the printer function to be performed.


│ biosprint│ _bios_printer │ Printer Function


│ 0 │_PRINTER_WRITE │ Prints the character in abyte


│ 1 │_PRINTER_INIT │ Initializes the printer port


│ 2 │_PRINTER_STATUS│ Reads the printer status


│ If cmd = 1 or 2 (_PRINTER_INIT or _PRINTER_STATUS), abyte is


│ ignored.


──────┼───────────────────────────────...


port │ Identifies the printer; 0 = LPT1, 1 = LPT2, etc.





return Value: current printer status, obtained by ORing these bit values together:





Bit│ Value│ Printer Status


═══╪══════╪═════════════════


0 │ 0x01 │ Device time out


3 │ 0x08 │ I/O error


4 │ 0x10 │ Selected


5 │ 0x20 │ Out of paper


6 │ 0x40 │ Acknowledge


7 │ 0x80 │ Not busy
Reply:DOS Command for parallel port printer to print a file:





system("print /d:lpt1 C:/afile.txt");
Reply:Does 'print' help?

hydrangea

How to sort a record in c++ using bubble sort?

I have record/struct variable which contains student first name, last name,student's course grade their age and GPA. I want to sort it with respect to GPA using bubblesort. but when I get done


only GPA field is sorted . But other fields are the same.


so GPA doesnot corresponds to right student. any suggestion that when GPA is SORTED all related members should also go in proper places.

How to sort a record in c++ using bubble sort?
nested for loops
Reply:it is just like the bubble that comes to the top of water


you just have to check each value in th array(GPA) with the succeding one and and swap all the entries corespondin to that gpa if needed to get a proper sorted list


Hey can i operate any machine(atlest switching ON and OFF) using C++ coding??

i mean to say i want to connect one simple motor to the computer.. and i just want to sswitch on and off with the use of computer.. can i do it with the use of the C++ programming. because i dont know any other launguge!!

Hey can i operate any machine(atlest switching ON and OFF) using C++ coding??
I would think you could you need to use com,usb,parrelle ports to do it. you might look at something like DCC for train (digitracks) they use a pc interface connected to a board dc54 to control train switch motors.


How to draw flowchart of matrix addition/multiplication in C-using FOR as nested loop ,any site 4 guidance?

program code is:--


#include %26lt;iostream.h%26gt;


#include %26lt;conio.h%26gt;





{


int a [10] [10],b[10][10],c[10][10];


int i,j,m,n;


cout%26lt;%26lt;"no. of rows";


cin%26gt;%26gt;m;


cout%26lt;%26lt;"no. of columns";


cin%26gt;%26gt;n;


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt;"enter matrix a["%26lt;%26lt;i+1%26lt;%26lt;"] ["%26lt;%26lt;j+1%26lt;%26lt;"]";


cin%26gt;%26gt; a[i][j];


}


}





for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt;"enter matrix a["%26lt;%26lt;i+1%26lt;%26lt;"] ["%26lt;%26lt;j+1%26lt;%26lt;"]";


cin%26gt;%26gt; b[i][j];


}


}


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


c[i] [j] = a[i] [j] + b [i] [j] ;


}


}





cout%26lt;%26lt;" matrix addition is "%26lt;%26lt;end;


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt; c [ i ] [ j ]%26lt;%26lt;" lt";


}


cout%26lt;%26lt;endl;


}


getch ();


}

How to draw flowchart of matrix addition/multiplication in C-using FOR as nested loop ,any site 4 guidance?
program code is:--


#include %26lt;iostream.h%26gt;


#include %26lt;conio.h%26gt;





{


int a [10] [10],b[10][10],c[10][10];


int i,j,m,n;


cout%26lt;%26lt;"no. of rows";


cin%26gt;%26gt;m;


cout%26lt;%26lt;"no. of columns";


cin%26gt;%26gt;n;


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt;"enter matrix a["%26lt;%26lt;i+1%26lt;%26lt;"] ["%26lt;%26lt;j+1%26lt;%26lt;"]";


cin%26gt;%26gt; a[i][j];


}


}





for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt;"enter matrix a["%26lt;%26lt;i+1%26lt;%26lt;"] ["%26lt;%26lt;j+1%26lt;%26lt;"]";


cin%26gt;%26gt; b[i][j];


}


}


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


c[i] [j] = a[i] [j] + b [i] [j] ;


}


}





cout%26lt;%26lt;" matrix addition is "%26lt;%26lt;end;


for(i=0;i%26lt;m;i++)


{


for(j=0;j%26lt;n;j++)


{


cout%26lt;%26lt; c [ i ] [ j ]%26lt;%26lt;" lt";


}


cout%26lt;%26lt;endl;


}


getch ();


}


How do i use a xsd document to extract data from a MSSQL server db and create a XML file of that using C#.net?

Hi,


I have created a XSD file now I want to use it in MS VS .net 2003/ 2005 to extract data from multiple tables like customes and their orders and the bills for those orders and create an XML file based on the structures setup in XSD . Would like to c a working example on the net if possible could someone pls guide me . I require to create an executable so any one can use it I have another utility wherein they can modify the xsd as per the requirements .


Many thanks


Meherdad

How do i use a xsd document to extract data from a MSSQL server db and create a XML file of that using C#.net?
try running this sample query against your db and check out the output. It will output the data in XML format. This will hopefully give you a start. Unfortunatly I don't have any C# code for you.





select *


from orders


for xml auto, elements





here is a good tutorial on the basics of getting data from SQL server in XML format and using XML schemas





http://sqljunkies.com/Article/53969753-E...

hawthorn

I want to write a c program in notepad .how can i compile and execute it in dos prompt without using c editor?

we can write java programs in notepad and we use javac, java commands in dos prompt to compile and execute the program.in the same way what commands are used to do the c programming compiling and execution.

I want to write a c program in notepad .how can i compile and execute it in dos prompt without using c editor?
java source code needs java SDK to compile the source then you can use 'javac' command, it is same for c language, you need a compiler to compile the c program, the simplest compiler that i know is Minimalist GNU for windows, after you install and set path in environment variables to the installed folder/bin , you can use 'gcc' command to compile your program. You can download MinGW in http://sourceforge.net/project/showfiles...
Reply:microsoft has a free C++ compile that's called the "express edition".
Reply:It depends entirely on which compiler you're using, but you'll have to set up a make file that has a list of all the files you're compiling, a command that causes the compiler to be invoked for each one (along with which flags should be sent) and another command to the linker to bind them all together into an exe. Make files aren't trivial to write, so your compiler will come with a number of examples that you can modify. Integrated Development Environments (like Borland, Visual Studio etc) aren't just editors, they also automate the make process for you.





Here's some more information:
Reply:Well, Borland has the closest thing, but that is years ago and now backwards. You typically use "includes" and libraries. The 'editor' is not the key and just soemthing they throw in with all the rest of it. You use command line switches to do the compiling from basic source code.