49,757 Topics
| |
Hi all, I am trying to figure out the code for searching a text file for a word/phrase and then replacing it. Both are user-input values. I've been having a tough time finding some help online because we are required to use get and put, [U]not strings[/U], unfortunately. The controllers … | |
Hi everyone, At the minute I'm trying to learn XML and reading/parsing xml files with c++ but I seem to be a bit stuck :( I've an xml file [CODE] <?xml version="1.0" encoding="UTF-8" standalone="no"?> <NormalisedFileCheck> <ExpectedFiles> <File>File_Num_1</File> <File>File_Num_2</File> <File>File_Num_3</File> <File>File_Num_4</File> <File>File_Num_5</File> </ExpectedFiles> <ValidProducts> <Product> <Family>Windows</Family> <Name>Windows 7</Name> </Product> <Product> <Family>Linux</Family> … | |
i need helping constructing an array of structs, this is my part of my header file which contains the following struct [CODE] struct PCB { el_t id; // contains the priority of the process string state; // current state of the process (e.g running) PCB *next;// link to the next … | |
[U]The first round of the game seems okay. The game will generate the result but >1 round , the result wont be show. And the is another mistake I found. For example, when the random no. is 5134 and my guess is 5143 the game will generate the code O … | |
Hi everybody, I have a problem and if you could help me as soon as possible I'll really appreciated I have finished a C++ program but I've got a problem in a small part of the program ,I tried to solve it many times but so far I couldn't figure … | |
Hi all, I ve been seeking a tutorial,article etc. about 2D cliext::vector . These are using <cliext/vector> library and cliext namespace. At once i need 2d vector decleration and its erase method to remove all rows which are full of zeros. Any help 'll be greatly appreciated. | |
i'm testing out a template function i created for a header file i'm writing, but it will not compile for some reason. it's giving me problems with iosfwd, although i'm not using it. [CODE]#include <iostream> using namespace std; template <class LOGICAL_AND> LOGICAL_AND __and(x, y) { return x==y ? 1 | … | |
Hey everyone, I'm trying to remove all punctuation from a string of characters. Here is the part of the code that I'm using to remove the punctuation from the string (string1 being the string). [CODE]for (int i =0; string1[i]; i++) { if(ispunct(string1[i])) string1.erase(i,1); } [/CODE] It is removing punctuation perfectly … | |
I have an assignment to program a simple program that names each member in my family and how they are related to me. The program compiles and all, but as soon as i type in any name, this is what shows up: Run Command: line 1: 3805 Segmentation fault: 11 … | |
i recently read that we can pass function to a function by using pointer to a function. i tried with an simple example.i defined sum function and passed it to average function so that it calculated average of return value from sum and 2 more nos.. rather than convenience point … | |
In the program below I am trying to overload the +, -, *, >>, <<, ==, and != operators. I cannot get the code to compile and am not sure what I'm doing wrong. I have posted the code and error messages below: Complex.h [code] #include <iostream> using namespace std; … | |
Here is what i got. I need to count the Uppercase entered in a string. Can someone help me? Enter string: The Brown Fox #of Upper Case: 3 My Progress: #include<iostream> #include<string> usingnamespace std; int main() { char string[15]; cout<<"Enter string: "; cin.getline(string,15); . . . . } I need … | |
in function stars code is returning garbage value if i input date between 20 Dec - 19 FEB (it should return 0) i want it to return either 0,1,2,3,4 satisfying the condition... Please help me with this problem!! [CODE=c]#include <iostream> #include <string> #include <stdlib.h> using namespace std; int stars(int date, … | |
Hello I am a new to C++ and have some questions. I have two classes called Point and Square like this: [CODE] class Point { int x, y; public: int getx() const { return x; } int gety() const { return y; } Point(int a, int b) { x = … | |
Hello, guys. I made a program to compare numbers, Example input: [QUOTE] 1 3 10 845157 2 1101101 16 5AE12 [/QUOTE] It transfers numbers from different number system to decimal, then it compares them, but it is not so fast as i need, maybe just a little advice needed, I … | |
Hello all. I am trying to convert this type of string [CODE] array<String^>^ files = OpenFileDialog1->FileNames; to a normal string. [/CODE] I am using a file open form for my program and the file name that comes from the Ok on click is in that form array<String^>^ ; I need … | |
Hello, I have a C file and .h file which i can easily compile on a 64 bit linux platform.( Through eclipse IDE. In the compiler option, i enable -std=c99. Now, with the same file, i want to compile it on c++ compiler. So i add extern c to the … | |
Hello! I'm trying to make a simple array that will increase its column size dynamicly and it will have 3 rows. On the 1st row i want the user to enter a name(aka char type) and on the other two rows i want the user to enter some float values … | |
I need help how to change the state of a process using link list queue. any help is appreciated. This is part of my code. what i need is that every time i insert a process im suppose to change its state to READY, and every time i need to … | |
So i have implemented the following link list, but i just want to know if i can sort the link list. any help? [CODE] #include<iostream> #include"ll.h" using namespace std; // PURPOSE: contructor which initializes front and rear to NULL and count // to 0 LL::LL() { front = NULL; rear … | |
Hi, I need help with a program that you enter X and Y, and the program has to resolve a)X^Y *Y b)X/Y it most be recursively and only using addition and subtraction. For division the result most has 2 digits of precision but only using integer example INPUT OUTPUT X=1 … | |
Hi everyone, I haven't really found much here on how to input into functions and I'm looking for more information on it. Basically my problem is this: I have to make a function that calculates feet into yards, and I'm trying to find out how to make it so I … | |
I have wrote this program in C++. But it doesnt have the output that it should. Instead of putting out +-++-+ it puts out ++-+++-+++++++-+++-+++--+++. That is just an example it will ofcourse have defirent output but it makes more characters then there is in the origanal string when i … | |
This here is a code of my recent uni assignment to render Mandelbrot, Julia and Burning Ship sets, using SDL. The code works properly, using MS Visual Studio 2010 Premium, but displays some errors (either numerical or type casting differences, I couldn't find them) after porting to Linux and compiling … | |
Hello. I compiled a basic GUI example written with Qt. When I run with valgrind, it tells that there is memory leak. It is stranger, because at each time I run the app, the number of malloc calls are different. Qt seems nondeterministic. [CODE] #include <QApplication> #include <QPushButton> int main(int … | |
I was trying to input strings into a structure I made, but I couldn't succeed. I use Visual C++ 2010 Express Edition. The code is this: [CODE]#include<iostream> #include<conio.h> #include<stdio.h> #include<string.h> using namespace std; struct schrec { char childname[20]; int childage; }; void main() { schrec record[20]; int n; cout<<"How many … | |
Hey there! I'm trying to write a program in C++ that will read information in from a file and then tell the user how many strings are in the file and the lengths of the smallest and longest strings. I know I can figure out the length of the strings … | |
Hi! I am working on a program to count the number of characters and words in a text file. The counting characters portion works, but my countWords function displays '0'. I built the countWords function on the basis of my countChar function, but since it's returning zero I'm not sure … | |
Hi everybody, How can i find out if a number is prime or not ? For example : [CODE]#include <iostream> using namespace std; int main () { int number; bool isprime; cin >> number; /*algorithm .............. .............. .............. */ if (isprime == false) { cout << "Not prime"; } else … | |
#include<iostream> #include<conio.h> using namespace std; struct biodata { string fname; string lname; string mname; string address; string pbirth; string dbirth; string religion; string citizen; string civilstat; string gender; string email; }*student; main( ) { int n,i,xx,c,d,a=0,e=1; char b,y; cout<<"how many records?"; cin>>n; cin.ignore( ); student= new biodata[n]; for(i=0;i<n;i++) { cout<<"\nLast … |
The End.