Beginners - July 2008 (Page 7)

by tyler
arranging a string/array of characters alphabetically
 
i've managed to find out the greatest/smallest character according to the ASCII values but i cant think of a way to arrange all the characters in alphabetical o...
[7 replies] Last: Here is a sorting algorithm for your problem. The code is written to... (by anilpanicker)
by tyler
function to output specific no. of chars of string
 
i'm trying to use a function to define a string and then calling its value in the main function. the problem is that i have to output only a specific number of ...
[1 reply] : You can use the substr() function to use part of the string. Here i... (by Mitsakos)
How do you print from within a function?
 
I do not know what I am doing wrong here: #include <stdio.h> int gcdlcm(int *a, int *b); //Prototype Variable void main() { int a; int b; ...
[4 replies] Last: Enter the first number:345 Enter the second number:213 GDC=3 LCM=24... (by Nandor)
getline not getting a line!
 
hi guys, I've finished my first year in a computing degree and I'm trying to get myself ahead of the game by learning some C++. I'm having some trouble ma...
[4 replies] Last: You guys are legends the lot of ya! I'm going through this book "le... (by DrumCoder)
Quick question!
 
Compiling the following code: #include <iostream> #include <string> using namespace std; int countVowels(string aLetter, string aString); int main()...
[1 reply] : The return value for string.length() in an unsigned int and i is a... (by closed account z05DSL3A)
by hamo94
i can't find the differance
 
i can't see the differance between my code and the example one in the tutorial under clases 1. i copyed the one in he tutorial by typing it instead of copying a...
[7 replies] Last: @Grey Wolf Sorry about that, I was reading something else from Zaita... (by closed account z05DSL3A)
Random Unicode problem
 
I have been trying to make a function that writes multiple files to a folder in the order; file1 file2 file3 ect. After some diagnostic coding I realized it wa...
[2 replies] Last: It worked!!! Thank You. (by blindingRage)
To call a function repeatedly after certain period
 
hi I need to call a function repeatedly after some fixed time(100 milli seconds). Which header files and classes should be used to do this.
[3 replies] Last: Neither sleep() nor any other user timing function can be 100% accurat... (by jsmith)
Errors and warnings
 
When I complie my program it said there were 7 errors and 2 warnings. Would someone please find out the errors and warnings and help me to fix it?? Thank you s...
[1 reply] : Where ever you have single quotes ' replace them with double quotes ... (by Mitsakos)
Multiple Requirenment for If statments
 
I don't know how to have multiple requirements for if statments, like do this if a = 0 and b = 0. I googled it and searched this site but could not find any dat...
[3 replies] Last: You also have if(a==0 || b == 0) { DoStuff(); } which... (by mikeb570)
Is this some secret code????
 
I got this code from a book. Can you tell me what OUL means. Is it secret code for something???? Its not defined anywhere. I was wondering if its something f...
[7 replies] Last: Wow. Thanks a lot for the help!! Yea, I was searching for O letter too... (by dhiltgen)
Strings combination
 
In this content, s1, s2 and s3 are strings If I wanna combine s1 and s2 into s3. Is there any related code that can used from library? The string S3 shoul...
[7 replies] Last: s1 + s2 is just a pretty way of writing s1.append(s2) , which in... (by Duthomhas)
by hamo94
i can't find the problem
 
can any one help me every time i come a cross an example in this tutorial i type it in to my compiler instead of copying and pasting to help me remember it bet...
[1 reply] : for(n=0;n<i;n++){cout<<p <<','; delete p;} ... (by Zaita)
UML diagram..
 
Can I create UML diagram in web programming?? If it is possible, what should i do or how should i do it??
[1 reply] : http://www.cplusplus.com/forum/articles/1295/ (by Zaita)
Problem: assigning strings to structures member
 
Hello all, I am trying to assign two movies to the structure MovieData then display those two movies. The problem I am having is with lines 29, 30, 34, and 3...
[2 replies] Last: Thanks a bunch for the help, Duoas. C++ get pretty tricky for me and i... (by jason387)
Decorator Pattern and Class Templates?
 
Hello, I'm not entirely sure if this is even possible, but is it possible to create a decorator pattern in C++ using template classes? I've written some ...
[3 replies] Last: Hey it worked! Thanks a lot! :) Also here is a link to it compilin... (by leeand00)
How does this not return a 2D Array?
 
Hi, a test case for my code is stored at: http://codepad.org/YWvbEQ6X, My boss says that my code does not actually return a pointer to a 2D Array as I've sta...
[1 reply] : You are both correct. :-] If you want to be really technical, you a... (by Duthomhas)
by hamo94
can someone solve this??
 
i was testing my knolage on c++ by making this code #include <iostream> using namespace std; int a,b,c,d=5,e,f,g,h,i; int main(){ cout<<"please enter ...
[5 replies] Last: thanks a million would never of quessed it thanks !! (by hamo94)
build solution with visual c++
 
Hello, I have VS2005 pro. I want to know how to build the solution with it making the EXE and all the BINs and DLLs so tat the program can run another comput...
[1 reply] : It will not "build" the libraries for you to include with your applica... (by arrrgh)
To std::string or not to std::string...
 
Hello, I am a little confused over why exactly c++ library strings (std::string) are faster in this example I ran across: Taken from C++ primer 4e (Lippm...
[7 replies] Last: Many string implementations use copy-on-write semantics. In your ... (by jsmith)
July 2008 Pages: 1... 56789... 15
  Archived months: [jun2008] [aug2008]

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