49,756 Topics
![]() | |
i'w wondering whether there is a difference between fstream and stdio.h when processing a file with these data [CODE] 10 10 P[/CODE] with fstream it's easier to get the data since with stdio.h i'd need to get every single char and number with getc() and translate i t into whole … | |
Hello sir, I am doing project on processors. I have a program called "START" and another program called "main". Now, i want to execute "START" program within the "main". I do not want to just call instead i want to run the "START" Program. please help me.. Thanku Krutthika ![]() | |
Hi, I'm trying to grab all the input sent to cout to modify and redirect it. I used the example from [url]http://www.dreamincode.net/code/snippet2499.htm[/url], which works fine using the following code: [code] std::ofstream file_sink("encrypted.bin", std::ios_base::binary | std::ios_base::out); basic_xor_filter<char> filter(*(file_sink.rdbuf()), 0x7F); std::ostream output_stream(&filter); output_stream << "Hello World" << std::endl; output_stream.flush(); [/code] The class … ![]() | |
Can someone please point me to a good windows api tutorial? The one that i found ([URL]http://www.winprog.org/tutorial/[/URL]) is nice, but it doesn't explain thing nearly enough. It kinda just drops the stuff on the person trying to "learn" it. I was able to follow through the first three sections, and … | |
I am developing a program that creates random mazes. One part of the program involves keeping track of the correct path. Each point on the path is a (row, column) coordinate. I am trying to store each coordinate as a 2 element integer array and push it back onto a … | |
I'm trying to learn C++, and I thought I'd start by exploring classes, so I wrote this: [code=c++] #include<iostream> #include<string> using namespace std; class user { public: string logonName; string firstName; string lastName; int uID; }; int main(){ user users[2]; int i; users[0].logonName = "rawrMander"; users[0].firstName = "Rawr"; users[0].lastName = … | |
I would like to change the case of the string value. (lower case letter to upper case and upper case letters to lower case) I wrote my program as the following. But linux does not know strlwr and strupr functions. What should I do? [code] #include<iostream.h> #include<conio.h> #include<string.h> const int … | |
hi gUd dAy evEry 1 my name is Marilou C. Arceño, a BSIT stUdEnt whO's asking a cOde for add,sOrt and alsO a search for a recOrd!!!! using C++ please help mE for this cOdE!!! esp. in syntax!!! hoping fOr yOur rEspOnsEd!!! | |
hi! i have a problem.. i want to make a program the will input your name and age, and the output will count the char i been input. but my problem is i don't know what would be the code so that i can count the char i been input.. … | |
I want to create a battle system for an RPG game, one a little more robust then the previous one I made. This one I want to be very dynamic and easy to use. I want to use the Allegro API for it, but first I want to make sure … | |
Should I avoid casting between data types? I haven't really seen much about the use of this, but it seems like one of those last-minute-no-way-around kind of methods... but, for example, how would I use the length of a string in a for loop? The length property of a string … | |
Hi, I was just wondering if adding debug symbols to my program, will slow down it's performance. I'm running linux. thanks in advance | |
So I'm having trouble with classes today, I want to do something like [CODE] #include <iostream.h> using namespace std; class Dummy{ char Name[256]; void setName(char nam){Name=nam;} }; int main(){ char[256] temp; cout << "Name?\n"; cin >> temp; setName(temp); } [/CODE] I want something like this to store a char array … | |
I am getting errors that I have never seen before in a program that uses class englishweight with float number and float eng_weight to output number*englishweight and other things in the EW_driver.cpp. Here is what my build log looks like: ------ Build started: Project: assignment_2, Configuration: Debug Win32 ------1>Compiling...1>EW_Driver.cpp1>Linking...1>EW_Driver.obj : … | |
when a cursor key is pressed, WM_KEYDOWN is received, and when it is released, WM_KEYUP is received. How can I get this same functionality with a character key? I found the messages WM_CHAR and WM_DEADCHAR, but they dont work like the above messages. Can anyone help? Thanks, Nick | |
Can I do this? [code=c++] while(variable=functionCall()!=0){ /* ... */ } [/code] the function I'm calling, is returning a 3, but the variable in the while loop is equal to 1... I'm not sure what is happening in this statement, Originally I thought it would just always evaluate to true and … | |
Hello everybody, I have a paragraph containing many sentences and I need to extract a certain sentence, which contains a certain. I have no problem finding the word with my code but my question is, how can I extract the whole sentence? The code should work, regardless of the position … | |
I have a code snippet i've been working on but not getting very far. What I have is a text file which looks like an XML but i want to get the data between the tags and ignore the tags themselves. I want to count the number of data items … | |
OK, I've been looking at templates recently and eveything was fine...never had a problem with them at any point. But then when I decided to write a function that would either return the given template type or not. the following code explains what I mean.[code=cplusplus]template <class T> T find(char x, … | |
Im on Windows XP pro. im using DarkGDK engine. I am making a FPS in a map that a tutorial provides. T tell it to load my object and position it under the camera and when i run it i look down and i can see it, but if I … | |
Hello all, i want to login to windows programmatically,if some one had done such kind of thing please do help me.i have authenticate the user with LogonUser() funciton of win32 api and have also placed my application to windows logon by replacing logonui.exe in system32 folder.but i am unable to … | |
I am having trouble finding out info regarding how to stop my application from "Beeping" every time I change focus with the "ENTER" key. For the sake of clarity here is the specific action and code which produces a sound (which I want to eliminate): I am simply trying to … | |
Hi everyone. I'm currently working on a Tic Tac Toe game, and I am having a little trouble with, well, I'm not even sure what to call them. They are a variable with brackets like so below. Anyway, I have this variable: [CODE]char Line_One[3] = { ' ', ' ', … | |
Hey, I am trying to create something like Lua but c++. What I want to do is create an Engine that calls a txt file and then outputs it in c++ so that I do not have to compile it every time and I can edit my source in notepad … | |
Hey, what I am trying to do is change the way people open text files in c++. What I want to do is: open("example.txt"); which will then open the text file "example.txt" and have a header file that displays like: [code] string line; ifstream file ("example.txt"); if (file.is_open()) { while … | |
So I've got this piece of software that is written in C++. I also have a website hosted on hostgator with linux server i believe. I have a MySQL database with usernames and passwords. What I want to happen is for my client application that is written in C++ to … | |
Hi, I have a file output.txt as follows : c FILE c c c p val 25 36 8 1 0 -1 -8 0 -9 -7 0 -9 -2 0 7 2 9 0 -10 6 0 -10 8 0 -6 -8 10 0 -11 -9 0 -11 -3 0 … | |
I am trying to overload operator++ for a type I have defined. Here' s a little explanation beforehand. I am working on a link_list class that can be used to create dynamic arrays of any type. I created a basic_link template to hold each element of the array. Each basic_link … | |
Hi, I wish to generate all the binary combinations for an input size n. So, the number of combinations in this case would be (2^n) and if n=2 my output should be : 00 01 10 11 How can i do it? What would be the best way? Thanks | |
Are there any reeeally good books on programming C++ that anyone knows of? Ones that just do an excellent job of teaching different techniques and clean coding practices, as well as things that can really be applied (like making and styling windows, communicating via TCP/IP, etc)? |
The End.