Beginners - April 2009 (Page 25)

Removing white space
 
Hey, i'm writing some code and i need the string entered to have all white space removed. I first tried this: #include <iostream> #include <string> usin...
[6 replies] Last: Yoinks! Nice catch Gumbercules (Fixed above) (by Duthomhas)
Food Menu
 
Deleted Comment
[15 replies] Last: Not a reply to the question you asked, but what does this mean? wh... (by guestgulkan)
My little program crashed..
 
#include<iostream> #include<time.h> using namespace std; class Time { public: Time(); void setalarm(time_t); void wait(int); private: int sec; time...
[1 reply] : the ctime function converts from time_t to a string, but not in that f... (by Gumbercules)
Array hint
 
iam looking for help, I dont know how to work with array whre you have to ask the user the values. Example******* Int main() { int xx ={1,1,1,1,1,1}; fo...
[1 reply] : I DONT KNOW IF THIS IS CORRECT??????? You can try it By the way,... (by Bazzy)
Recongizing substrin using HashFunction
 
Hi, mates! I'm trying to write a program to recognize a substring in a given string, using hashing. The common STL string methods doesnt work for me, because ...
[6 replies] Last: Thank you for the answers. May be you've heard about the Rabin-Karp al... (by MrProfit)
by dman
inline functions
 
In headers, if an inline function is declared inline in its implementation .cpp file, do i also need to add the inline keyword to the prototype in the .h file...
[3 replies] Last: If the function is implemented in the .cpp file and not the header fil... (by jsmith)
array to array ?
 
#include <iostream> #include <string> using namespace std; #define DEFAULT_SIZE 5 typedef char SubjectCode ; class Student{ privat...
[1 reply] : yes, and copy the data. (by Gumbercules)
Im hoping this can be a simple fix :/
 
My Problem: I am trying to take a large .txt document and find and remove duplicate words within the text. However, the .txt document was a novel and it conta...
[5 replies] Last: if you were wondering, the problem was that you can't compare that way... (by Gumbercules)
by h0d3
Number Generator
 
Hi everyone!!!! Im a beginner in c++!!! I want to make a program that displays a 3 number combinations from the inputted numbers.... Example: 3 4 5 3 4 1 di...
[6 replies] Last: Do you or do you not want to show duplicates? If the array is 1, 2,... (by jsmith)
Perfect Numbers
 
I can't quit figure out how to print only perfect numbers. i.e. 6 factors out to 1, 2, 3. and 3+2+1=6, thus making a perfect number. I have a program built th...
[3 replies] Last: I haven't any clue what you are trying to do. Why are you using sp... (by Duthomhas)
how to manipulate files (move, delete, copy,etc) in C++
 
Hello everyone Btw I am still new in C++, n i want to ask several question about it (maybe it seems stupid, but i really want to know about it). Does anyone kn...
[5 replies] Last: @Duoas well, i still does not understand about the instruction......m... (by e0ne199)
by wenwei
read numbers to 2D array
 
I am trying to read numbers from a text file converted from excel spreadsheet that contains null values. I used "inFile >> myArray ;" but >> seems to ignore NU...
[1 reply] : You should open the file in binary mode and get data in an unformatted... (by Bazzy)
Adding commas to a set of integers.
 
I was wondering how to add commas to my output. It just prints the perfect numbers, and their factors...but I was wondering how to add commas. /*Should cal...
[2 replies] Last: Why are you using half C and half C++ output? (by Bazzy)
Makefile in visual studio
 
Hi, I want to write some code which can be portable to linux as well as on visual studio using command prompt. I tried doing as suggested in: http://mrbo...
[1 reply] : doing make on windows and linux is different, on linux there is make ... (by writetonsharma)
by destro
Loop trouble
 
I have a debug file that i can't seem to well debug. I have tried moving around the loop and adding an if statement but i still can't get it to work right. Any ...
[2 replies] Last: Thank you so much. I thougth for sure i had tried that but turns out i... (by destro)
How to make a represent the letter a
 
My problem is simple. How can I go about making the value a represent the letter a. I need to make it so someone can type 'a' into the program and have it trigg...
[2 replies] Last: Thank you. That fixed my issue. I have a new problem though. For some ... (by thekingofbs)
problem with specialized template class with non-type parameter
 
I am trying to do a specialized template class of char with non-type parameter. However, it doesn't accept the specialized one and gives error message: error...
[9 replies] Last: My suggestion: // template class Container to contain array of typ... (by guestgulkan)
Copying a vector that is inside a struct
 
Was wondering if anyone could look at me code stub and see what im doing wrong. Im trying to use a generic structure that holds a vector and im trying to pass i...
[4 replies] Last: Opps thats correct im changing it now, thanks. (by newbie43)
how to use for statement?
 
I understand it's used in loops, but how exactly? Can you give me example on how to use it, like: cout << "asks user to input a number"; cin >> number;...
[7 replies] Last: The only good thing of goto is that you never really need it... (by Bazzy)
by XyRoN
Timed Input
 
Hi all, I need the command (and its syntax, ofc :P) for a timed input similar to getch(); Essencially i need a command that will wait for a set ammount of ...
[no replies]
April 2009 Pages: 1... 232425262728
  Archived months: [mar2009] [may2009]

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