Beginners - April 2013 (Page 24)

overloading <<
 
I'm trying to overload ofstream << to print to a file. I have 3 files. One header, and 2 .cpp. I'm opening my file in my main.cpp but I only get a blank text fi...
[1 reply] : Can you show your code in main where you write "FileOut << SomeShape <... (by LB)
draw pentagon with *
 
Is there a way to hard code a pentagon in the console with a loop? I've done it for a triangle so am trying to find a similar way to do it. cout<<" \t...
[2 replies] Last: I would draw a triangle, and then draw half of an upside triangle with... (by Lowest0ne)
Using separate compilation
 
I have some errors popped up when attempting to compile the files. I'm using a header file, which is imported to the implementation file. The header file pretty...
[3 replies] Last: On second thought, your Body.cpp looks fishy class Body { Body (); ... (by keskiverto)
by Embers
For Loop help
 
I'm trying to to get the individual strings from ATG to TAA, ATG to TGA and ATG to TAG. Input File: XATGXXXXXTAAXYATGXXXXXTGAXZATGXXXXXTAGX Goal: ATGXXX...
[3 replies] Last: The revised version scares me: for (int i=0;now.find("ATG",i)<now.s... (by keskiverto)
code assistance: the << after outputFile in the writeStudents function is showing an error. Please advise.
 
Write your question here. I need to access the file inputFielName.txt however the computer said asertion failed. I guess the program is not reading the file....
[2 replies] Last: I need to access name, grades 1-3, average, and status. Please advise ... (by Christian Molto)
by joet12
vector problem
 
I am a beginner in this and im having problem with a program, i want to make a function that will search for a spicific word in a sentence. Got stuck on the vec...
[12 replies] Last: Ok. I installed code::blocks and checked the code but it is complainin... (by joet12)
Evaluate my code please?
 
Is everything here okay? It works, and I think it looks pretty clean but let me know if i did it right and didn't use anything un necessary. Its the first time ...
[9 replies] Last: One more "Hello World".:) #include <iostream> #include <string> te... (by vlad from moscow)
by Aden8
STL queue class
 
This program reads an even number of characters. The program then prints the first character, third character, fifth character, and so on. On a second output li...
[2 replies] Last: this is one of the most over complicated programs I've seen so far... ... (by coder777)
Merging vectors help?
 
This is a program where it merges 2 vectors into one. As you can see, the program prompts the user to input elements for each vector. However, when I input -1 i...
[1 reply] : This loop is infinite if the first entered number was greater than -1.... (by vlad from moscow)
by Fyah
whats wrong here?
 
im practicing a code i made up ( id o realize it does not make sense but the purpose of it is to see if the void type and functions work. now everything is work...
[6 replies] Last: @Fyah I would recommend setting up your editor to replace tabs with ... (by TheIdeasMan)
appending vectors then testing output
 
My roomie and I are in a class and we're trying to do a project.... I get error's when i try to compile this program and i'm not sure why. i'm trying to crea...
[2 replies] Last: for (int count=0; count<10; count++) { vector<int> mya; cou... (by cire)
reverse digits
 
which function must i use to write a number in reverse and if the number is 5600 must be 65 . .
[2 replies] Last: First question is the number in a integer? If so there are a few ways ... (by closed account 3qX21hU5)
Removing Scroll Bar properly?
 
I decided to remove the scroll bar from the console, and I want to know if this is a safe way to remove the scroll bar without any conflicts. Although I know I ...
[no replies]
Matrix return
 
Is there a way to make this code more efficient? It works as it is at the moment but do you think it's not the best habbit to return Temp so many times? Ma...
[3 replies] Last: What I need to do is actually get all the vertex points of the hexagon... (by vanessatse)
error C2582: 'operator =' function is unavailable in 'EDIN::Neuron'
 
I have a class called "Neuron" for which I do not have a copy constructor, as I don't want to copy it. However, when I try to compile my code I get this long pi...
[5 replies] Last: Member function resize calls member function erase if the new size is ... (by vlad from moscow)
[win32api] can't close dialog
 
I encountered this weird problem SEVERAL times, I have no idea how to fix it, but I did it all the time, however I kinda can't fix it now, any suggestions? #...
[1 reply] : fixed, I forgot to set window class in the resource, I hope I won't do... (by mekkatorqu)
Help with saying hello world C++
 
I am trying to say hello world, but it is not working, after I want to do stuff. import <iostream> public static int main(String args ){ System.out...
[6 replies] Last: #include<iostream> using std::cout; //print output using std::endl; ... (by eyenrique)
If statement troubles
 
Hey guys, I'm a very nooby and inexperienced programmer and am trying to get some concepts through. This script is supposed to tally the amount of votes place...
[2 replies] Last: goddd dangggittt, haha, thanks a lot man :) (by BlueKazoo)
by herold
Help me..I'm stucked here.
 
Dear friends, I was writing code of simple Mono alphabetic substitution cipher and i got this error. I observed this kind of error previously and it was solved...
[3 replies] Last: Another easy fix for line 10 would to make it a string like string al... (by giblit)
a c++ program
 
hi everyone; i want a help immidietly in this program i wanna give a 3digits num and the program show * as the number of digits. like 352 *** ***** **
[12 replies] Last: thanks thanks thanks thanks thanks thanksthanks thanks thanksthanks th... (by omegam1)
April 2013 Pages: 1... 2223242526... 83
  Archived months: [mar2013] [may2013]

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