No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
8 Posted Topics
first think about the math behind it all 0+0=0 C=0 1+0=1 C=0 0+1=1 C=0 1+1=0 C=1 Your function is void binaryAdd(int* sum, int& cBit, const int* bin1, const int* bin2) sum=sum of two digits cBit=Carry bit bin1=binary number 1 bin2=binary number 2 to implement your funcion you need to call …
This is the file I will be calling from, basically it stores something into a file called "temp.txt, so let's assume that it works and the problem is not here. This is the "file.h" file. [CODE]#include <iostream.h> #include <fstream.h> #include <string.h> #include <stdlib.h> ofstream output_file("temp.txt", ios::out); class NUM_STUD: { public: …
is it outputting 2 7 10 3 15 I bet it is, you wonder what might be the problem now huh? Writing out in words what your doing goes a long way [ICODE]for(j=0;j<5;j++) { for(i=0;i<5;i++) { if(A[i]>A[i+1]) { swap=A[i]; A[i]=A[i+1]; A[i+1]=swap; } } }[/ICODE] to me this means: [LIST=1] [*]start …
Please take this help lightly , don't be a sponge actually try to understand why the function I show you works and you will be better off. All programs can be written using regular conditional statements but this usually takes a long time to write. Try to think about what …
I have succesfully done this but with one error. using ... ifstream input("infile.txt",ios::in) while(input.good()) { input.getline(file,100); outputfile<<file<<endl; } then I have some new code that writes this into another file. You may laugh when you hear this but the problem is that it add an extra line to the output …
[QUOTE=WaltP;573870]You cannot compare strings with the == operator. Look up the function [icode]strcmp()[/icode][/QUOTE] true so call conditional statements like this if (strcmp(command1,"enter")>0) if (strcmp(command1,"enter")!=0) should work
[QUOTE=nurulshidanoni;573808]I have this to file.First [B][U]ayam.txt[/U][/B] 10 20 30 60 90 50 40 [U][B]and itik.txt[/B][/U] a b c d e f g h i How to call read and write the ayam.txt and itik.txt into one file. which first i would like to cout the ayam.txt and then itik.txt.[/QUOTE] [ICODE]#include …
Hi every one I have a big problem, I need help with creating a program which reads every third word in a text file and excludes puncuation like -,?.!'" etc.. so far none of my work need code or suggestions just plain help(newb) [code] #include <iostream> #include <fstream> #include <string> …
The End.
scarface3288