General C++ Programming - March 2013 (Page 7)

for loop
 
i have assignment about for loop and this is the instruction for the program (Prompts a user for number of exams taken Uses FOR Loop to interate (loop) up to...
[1 reply] : I think your formula is the problem sum=numExams+sum Besides the fac... (by zoran404)
Reading group of numbers per line in text file
 
I am working on a project for school that has us read in a text file that contains 8 lines of SSN and grades. I am not sure how to go about reading in the lines...
[1 reply] : getline reads file till first nev line char as for the fifference diff... (by zoran404)
Dungeon crawl
 
im trying to code a simple text based dungeon crawl i am just testing so far and its not working this is what ive got #include<iostream> #include<vector> #in...
[1 reply] : What specificaly is wrong? What should it do and what dose it do? (by zoran404)
Functions without parameters
 
Summary: 6 companies have a product in 5 different warehouses. Each company is identified by a positive ID number and each warehouse is identified by a number (...
[17 replies] Last: thanks you i solved it :) (by baketballcourt)
How Remove An Element Of A List
 
How can I remove an element in a list when I have only an iterator that points to the object I want to remove. Is there a build in command? remove() takes an ob...
[2 replies] Last: Thanks, pointers on steroids :) (by martianxx)
read a string
 
char name ; To read a string from keyboard. what should i use : this : cin>>name ; or this : cin>>*name;
[3 replies] Last: I recommend cin >> setw(10) >> name; , otherwise you risk buffer over... (by Cubbi)
Classes Callback problems , Delegate
 
my delegate.hpp #ifndef __DELEGATE_HPP__ #define __DELEGATE_HPP__ class Callback { virtual void Call(void* indata); }; template <class T> class...
[1 reply] : line 30 of delegate.hpp: ( This ->* func ) (indata);//If you don't k... (by MiiNiPaa)
Code to write a program to a file
 
Can someone send me the basic code for writing output of a program to a file? I can't seem to find it online and I need it to complete a project. Thank You!
[2 replies] Last: That's the one I found earlier. Thank you for confirming it works! (by madeinsilence)
help explain
 
i have a infill code,but the problem is that i don't understand why put ! in this code(!in.is_open()) i understand that is_open to check whether the file has...
[1 reply] : The ! is a logical "not". You already know that: if ( in.is_open... (by Stewbond)
Case and or C++
 
Hi guys I have a question; Can I use case argument with an or parameter? Example. switch(lol) { case "a" || "A" { /* do something */ } } Because I ...
[4 replies] Last: Yeah nice one, thx all :D Sloved (by puntoinfinito)
by Banhas
Segmentation fault
 
Hey guys. Yet again, I have this type of problem, I was wondering if anyone could give me a hand with it? The problem lies on line 69, "sum += matrix * y ;"...
[7 replies] Last: What are the values of i and j at the time of the crash? (by MikeyBoy)
Loan Calculation
 
I'm new to C++ and haven't been able to practice some of it because family issues (loss of member)and a busy school schedule. My instructor told us to do a loan...
[no replies]
STL and FILE I/O problems
 
Hi! I'm experiencing some problems in C++... 1. STL I'm using a map template like:- map<string, string>table; to implement a sort of a word->meaning ta...
[6 replies] Last: map<char*, char*> table; table["why"] = "word_why"; table["hello"]... (by Abramus)
HELP NEEDED. IPO CHART
 
hi there. can anyone help me with the ipo chart? I have the pseudocode with me. Its due in 2 days. Help needed asap ! :(
[1 reply] : What is "the ipo chart"? We don't have the one you have. (by LB)
by tomz6
Getting pixel information from fonts?
 
How can I import a font file and get the pixel information of the letters so I can make my own custom text drawing function? I basically have a pixel surface...
[1 reply] : http://freetype.sourceforge.net It allows you to load different true ... (by Abramus)
guess word game
 
i have project with guess word game. I have done a Beginner . Game including 3 level is beginner,Intermediate,Complex be saved in 3 file text. I need your help...
[no replies]
by nunks
Get input from .txt
 
So me and my groupmates suddenly have some clutchwork at hand. I was assigned of making an import function that reads through a textfile that looks like this, a...
[12 replies] Last: Thats because my game only accepts 2d vectors as a gameboard. But how ... (by nunks)
How to simplify this code
 
I think that there is way to many if statements. #include <iostream> using namespace std; //declaring the constant number and naming it as LUCKY ...
[1 reply] : You could change it to: if ( (a==LUCKY) || (b==LUCKY) || (c==LUCKY) ... (by doug4)
by Medino
Binomial Coefficient
 
I need help with this: For given integers n and r calculate the binomial coefficient with this formula: [n above r] = r!/(n-r)!*r! Write the read numbers a...
[1 reply] : It sounds like you need to step back and think about how to break the ... (by doug4)
A Map of Regex and string
 
Hi! I want to create a map contaning a regex as key and a char* as an attribute , like:- map<regex, char*> res; res["[[:alnum:]]"] = "alphanumeric text"...
[13 replies] Last: No, it's the same problem... Vector pairs solved the problem! (by syndrome)
March 2013 Pages: 1... 56789... 51
  Archived months: [feb2013] [apr2013]

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