Beginners - April 2014 (Page 65)

search for word in text file, display entire row once found
 
I've been trying to figure out to search for a word in a text file and then display everything in the same row as the word found int ie this is whats in the ...
[5 replies] Last: ok here is the working code. void KeyWord(ifstream &FileSearch) { ... (by dariusd7)
by vgarza
unresolved overload function
 
Looking for some help - I am sure the problem is right in front of me, but I keep missing it. Can you help me find the error in line 7 #include<iostream> u...
[1 reply] : change it to : cin.getline( name,20 ); btw, as u can see, character... (by nvrmnd)
by Huppa
While Loop - Counting by 10s
 
Hello! - I need to use a while loop to print the numbers 0-100, counting up by 10s on one line. On the next line, I need to print out the sum of the numbers...
[2 replies] Last: @billywilliam, Thanks for the help! (by Huppa)
storing matrix in a 2D dynamic array
 
I am trying to read a matrix (that I know how many columns and rows it has) from a file and store it in a 2D dynamic array. I create my 2D array like this. ...
[1 reply] : Example // istream::get example #include <iostream> // std::cin... (by Amil Patel)
by Neo561
File Processing
 
Learning my first programming language and am having trouble. Firstly , the myfile.dat looks like 1Kmp6z|Johnny Five|123 Mains St|9.52| Part number ...
[1 reply] : To save it on XML you will need to import a library file. Create the p... (by Amil Patel)
Overloading left stream operator?
 
Hello! I'm trying to overload the left stream operator so that it'll add elements to a vector. I'm really stumped as to why I'm getting an error. Here's what I ...
[2 replies] Last: That cleared up so much! Thank you! :D I need to work on thinking mor... (by ECEsasha)
Day of Year Program help!
 
Modify the DayOfYear class, written in the earlier program, to add a constructor that takes two parameters: a string representing a month and an integer in th...
[no replies]
(Code is entering fail-state) How do I fix?
 
Hey everyone, I'm having a hard time finishing this program. I'm brand new to programming and any help would be appreciated. This is what I have so far. I'm pre...
[6 replies] Last: Any help guys? (by jmcdaniel10)
prompt the user
 
I have to write a code to prompt the user for the name of the input file and continue to ask the user for the name of the input file until a valid input file is...
[1 reply] : while(!file.is_open()) { std::cerr << "Error - " << filename << "... (by giblit)
Arrays in user defined function for matrix addition
 
I'm trying to write a user defined function that will take two arrays as arguments and return the sum of the two matrices, the problem seems to be something to ...
[6 replies] Last: ok, thanks (by George6626)
Question about semaphores
 
dont want any code but could someone point to me where it is I'm going wrong. keeps saying undefined reference to signal. Am i supposed to write my own def for...
[no replies]
array vs pointer to array question
 
Hi, I'm confused about the following situation: The following code when I use an array works fine //declare vertex glm::vec2 vertex ; //a very large size...
[5 replies] Last: vertexSize , once set, remains constant during the whole program, but... (by santiagorf)
by iluv41
stuck in this loop?
 
I have this function but no matter what the user enters it says invalid input. Any suggestions? char GetChoice(char selection) { cin >> selection; ...
[3 replies] Last: So... selection is 'y'. selection != 'y' || selection != 'n' || !cin... (by S G H)
Two Highest Numbers
 
In this program I'm supposed to find the two highest numbers of a series of numbers entered by the user. I have the program to collect the series from the user ...
[11 replies] Last: for(int i = 1, i < (amount - 1); i++) { highest(number1, number2); }... (by Smac89)
Float???Double???
 
I can't get my float to display decimals................What the hell! I know I'm passing a multi int's , but what the hell? float averageValue(int a, i...
[2 replies] Last: Thank you........It all makes sense now. (by sagebrushwilly)
Idiot proofing a GCD and LCM finder
 
Hi, I'm new to C++ and I have this program that works, it just needs to be idiot proof. If you could help that would be greatly appreciated! # include <st...
[10 replies] Last: Thank you very much! And I'll definitely look into those tutorial site... (by Gregnog)
Errors C2228 & C2065
 
Just started a programming class this semester, and haven't been having much trouble with it thus far. However, after writing around five classes without a pro...
[2 replies] Last: Ah, thanks. Always a frustrating feeling when the solution is so simp... (by TheOneOnly)
How do I use arrays?
 
I've been reading the tutorial for arrays. From what I got, this code int num {1, 2, 3, 4, 5} is supposed to output 1 2 3 4 5. I'm not sure if I'm missing...
[3 replies] Last: The number you are seeing there num is the last value that was held i... (by andy1978)
Returned values
 
Code executes fine, but the values that are returned are not correct. For example I get a value of 00136C57DA. Does this have something to do with the formulas ...
[2 replies] Last: how do i solve this, im trying to create a program that translates fro... (by patriboyD)
Operator overloading with vectors?
 
Hi! I'm trying to overload the + operator to add vectors, and checking to make sure they added correctly in my main function. When I compile the two .cpp files...
[6 replies] Last: When I just ran my code in Ubuntu instead of in Windows with gcc, it w... (by ECEsasha)
April 2014 Pages: 1... 6364656667
  Archived months: [mar2014] [may2014]

This is an archived page. To post a new message, go to the current page.