Beginners - May 2012 (Page 6)

Could someone explain how the below c++ code works....??
 
Code to determine mode . double mode (double numbers , int i) { int* Repetition = new int ; for (int i = 0; i < n; ++i) { Repetition = 0; ...
[1 reply] : The code has 2 somewhat serious problems, and 2 other oddities: 1) i... (by Disch)
by TrAnMu
Declaring a String Array
 
I'm having trouble with this declaration. I've tried every way that I can think of but I keep getting more and more error messages. This is the least I could ma...
[2 replies] Last: Thank you so much! It's running properly now. I guess that's what happ... (by TrAnMu)
by seth23
Display formatting
 
Hi, I am trying to make it to where I can out into a descending or ascending order. Like ********** ********* ******** ******* ****** //so forth so on h...
[5 replies] Last: Nice, that works well--thanks! (by seth23)
formatting the output
 
why formatting the output cannot be run in cfree? but can run in jgrasp.. for (int j=0; j<i; j++) { cout<<"\n\n\n-----------------------------"<<...
[2 replies] Last: ok thanks for your advice..actually i'm not good in english..so i'm tr... (by sisie series)
by kethgr
String array input problem
 
Hi everyone, I'm trying to write a program that inputs candidate names and vote tallies from the user and outputs the name, tally, and percentage for each. It c...
[5 replies] Last: I got it. Thank you for your help. :) (by kethgr)
Hangman build errors
 
The "Word.length" in my code is showing red underlines saying "Error: a pointer to a bound function may only be used to call function." I googled but no luck, a...
[16 replies] Last: Your correct == 0 test should be outside the for loop, since you don't... (by BlackSheep)
stringstream problems
 
Hi guys, Need a little help with string stream. This is my first time using it, but with little success. I need to take a double number, make it a string, th...
[2 replies] Last: Bingo!! Thanks a lot! (by toomanystars)
pow function issues, need help.
 
I'm just beginning c++ and i need some help with this code. I'm trying to figure out why my command prompt gives my the answer 8 when i run and build this code....
[4 replies] Last: Thanks man, yeah im really new to this but that makes sense :) (by purl3paul)
by Ch1156
am i doing this right? (classes)
 
My code compiles right but i wanted to know if i built it correctly. Also thats how i access private variables right? by creating a constructor? class CLA...
[5 replies] Last: ok but i dont want the function to add six and seven in the class i wa... (by Ch1156)
overwhelmed at where to begin
 
Ok, so I've been trying to do searches and asking questions from experienced people and have gotten no answers yet as to where I should begin. I'm coming h...
[10 replies] Last: It's not terribly outdated, but I would recommend also getting a used ... (by BHX)
by jorz
define class different headers
 
hi there, I have two header files Form.h and serial.h in Form.h I declare and call a class like this: CRC df1; // define class crc = df1.CHECK(crc,...
[2 replies] Last: the crc = df1.CHECK(crc,buffer ); line is called for sure I stepped tr... (by jorz)
implementing functions :/
 
The following is my program for an assignment and somehow its not working..can someone tell me what is wrong..:) #include <iostream> #include <stdlib.h>...
[16 replies] Last: yes..finally figured it out... thnx for so much for helping. God Bless... (by molia2991)
Linked list problems
 
I had linked lists for my assignment and I literally wasn't able to turn in anything because I knew what I had was wrong and didn't want to come here and "cheat...
[1 reply] : I got it to work! OMG, I feel soooo coool!!! Most people here are pro'... (by voyance)
In some none understandable cases, push_back for vectors does not work
 
Hi all, I really don't understand what happen. In my test program, it works : vector<string> t1; cout << "t1 should be empty - size = " << t1.si...
[10 replies] Last: OK. Thanks. The initial problem is not anymore reproducable. I real... (by lalebarde)
by LF5d
problems with concatenating cout and cin.get().. (1,2)
 
Hi all, I am new to C++ and I wrote a test program to print out characters that are left in the input-stream when cin encountered inappropriate input, however I...
[25 replies] Last: Yeah, they became too busy chastising him for his folly. (by BHX)
how to read this file
 
I've been working on this all day and am running close to a deadline, would be fantastic if anyone could help. I have a file formatted as follows: charac...
[3 replies] Last: ifstream file = new ifstream("file_name.txt"); new? Surely not :) ... (by Moschops)
by Grax
what is the purpose for using ADT
 
i have been reading some books that they used/ include ADT in their class. in the ADT class there was many virtual function and some pure virtual function (with...
[5 replies] Last: Yes I alco mean the definition. A definition may be provided for a pur... (by vlad from moscow)
Problem with strtok
 
Hi, I have problem. I need to printf how long is one company opened. Data is in txt file. For example I got company A and it is opened M-F 11-19 (monday to fr...
[3 replies] Last: I think Mr. Vlad meant, is the format of the opening hours always [1 l... (by closed account o3hC5Di1)
4byte to integer
 
Hi, I guess this is an quite simple question, but I wasn't able to find a solution for this problem using Google (: I simply don't know WHAT I need to search fo...
[3 replies] Last: By using bit shifting and bitwise or: const char* str="aBcd"; const i... (by Athar)
ios::good() problem
 
I'm calling ios::good() in my code as follows: fstream read_trace; string line; vector<string> lines; read_trace.open("tracecomepare.txt"); cout<<"stat...
[4 replies] Last: Note that after you get the file to open, that input loop will run pas... (by Cubbi)
May 2012 Pages: 1... 45678... 59
  Archived months: [apr2012] [jun2012]

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