|
escape sequence - inserting into a ofstream Consider: int main() { std::ofstream output_file; output_file.open("Tmp.dat"); unsigned int const max_len ( 0x1000 ); char output_line[ max_len ]; output_file << "<control>\n"; //sprintf(output_line, "<suite index=\"%d\">\n", 15); // yeah i know isstringstream or ... //output_file << ou... 30 Mar 2006 21:26
Need help converting binary to decimal. Hi.I am currently studying programming in C and have to write a program that converts a binary number (0 - 1111111) to decimal. Is there a way to do this without using string functions? Is there a function in any header files that I could use? Thanks :) ... 3 Apr 2006 23:23
sorting the names in the ascending order Hi, I have a confusion in sorting the names in ascending order.Is that necessary to use toascii function or strcmp function or anyother to solve my problem. Congratulations! if solved my problem..... Reply soon..... ... 29 Mar 2006 14:58
help with program Hi! I'm taking a class in c++ and am having to write a pretty big program that involves vectors, push-backs, etc. I'm trying to do this thing one step at a time to make sure everything works right. The problem I'm having is that when I go to run the program, all I see is "Press any key to continue", I do... 29 Mar 2006 21:03
Inline asm C code problem I'm writing a program for a class mostly in assembler converted originally from c-code. The problem I'm having is that whenever I make a c-function call from within the inline assembler, I'm getting an "Unhandled Exception" error. It goes something like this: void getData( int* n, int* r ) { char scanString... 21 Mar 2006 21:39
A recursive BFS of a graph I am looking for a way to do a recursive breath first search(BFS) of a graph as an academic excersice. currently could only do it iteratively : int G[N][N]; // Adjency matrix void bfs(int start){ queue<int> q; q.push(start); visited[start]=1; while(!q.empty()){ t=q.front; q.pop(); for (i=0;i<N;++i... 22 Mar 2006 07:26
try catch blocks Here is a program that I wrote as an answer to one of the exercises from "You Can Do It!" by Francis Glassborow: #include <algorithm> #include <fstream> #include <iostream> #include <vector> #include "fgw_text.h" #include "utilities.h" using std::cerr; using std::cin; using std::cout; using std::endl; ... 21 Mar 2006 05:46
ifstream - problems locating the input file Hi all, I think i'm being very stupid here but its driving me nuts! I'm running borland builderX on windows and trying to run a very simple program using ifstreams. For some reason i cant get the ifstream object to find the specific input file i want to process: int main() { ifstream in ("C:\junk\C02\myfil... 21 Mar 2006 17:21
Matrixes HI! i dont know how in C or C++ to fill two or more dimensional matrix (data from file!), necessary data in a file must be saved in this format: x x x x or x,x,x,x values may be separated by space or comma. alghoritm can fill up to 10000 rows. (i needed for numeric alghoritm to operations at matrixes... 17 Mar 2006 21:31
Solving problems Hello, I am looking for some ideas of C projects to work on. Some examples of things that I am looking for are: Solving the solitaire board game / Rubick's cube Programme to play a perfect game of Blackjack Video/music database Network minimisation solver (OR algorithm) Anyone got any more? Personally I wa... 31 Mar 2006 22:20 |