hey guys, I was wondering if you can look over some code:
1. char* reverse(char *s);
*Here, s is a C-string. Its return value should be a newly-allocated C-string, said string being the...
Type: Posts; User: jewelz
hey guys, I was wondering if you can look over some code:
1. char* reverse(char *s);
*Here, s is a C-string. Its return value should be a newly-allocated C-string, said string being the...
ok..im just getting a compilation error for just one algorithm
template <class In>
void my_fill(In b, In e, In t)
{
while (b != e)
*b++ = t;
}
whats wrong with this piece of code? its giving me a compilation error saying "expected constructor, deconstructer, or type conversion before my_min_element"
template <class In>
iter...
hows this:
bool my_lexicographic_compare(In b, In e, In b2, In e2)
while (b != e)
{
if (*b2 < b || b2 == e2)
return false
ok i indented the code...and I also included the driver program - this should not be touched at all..
#ifndef GUARD_myalgorithm_h
#define GUARD_myalgorithm_h
template <class In, class Out>...
hey guys..need some help with a project...im basically to implement the following 5 algorithms for a driver program...
here are the algorithms:
accumulate(b, e, t)
equal(b, e, t)
fill(b,...
hey, thanks for your help, I figured it out. here is the final update:
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
yeah it doesn't print anything after Grade Distribution..and here is the updated code:
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <string>...
You're right..i deleted that portion and it still works fine...the final part, however, still doesn't seem to work..
sorry I don't want to be bothersome, but this homework is due pretty soon, and I really am not sure what seems to be the problem...
anyone?
Hey guys, I need some help...the HW description is basically that I have to allow the following program to print letter grades for each student following a certain criteria, and then it has to print...
yeah..i made a silly mistake =) anyway thanks for all the help guys..really appreciate it
Thanks guys i got it to compile, but i have a problem when running the program.. basically the program is supposed to read from the input and output the longest palindromes, along with it's...
here is my code for the entire project:
pal.h
#ifndef GUARD_PAL_H_
#define GUARD_PAL_H_
#include<string>
well i included the <string> and compiled it again, this time the only problem is that it's saying that there is an undefined reference to 'isPalindrome(std.....)
i dunno what to make of that...
yeah but one of my classmates said he didn't need to include that in his pal.h and it ran fine..plus i thought header files are generally not supposed to have them anyway?
Ok now on to fix the problem that I have been having since completing the first part of the assignment (output just palindromes)...the compiler is telling me:
pal.h:4: error: 'string' in namespace...
hmm..getting a compilation error..it's saying:
error: expected identifier before '(' token
indicating the line with while (cin >> s)
typedef string::size_type string_size;
is everything good now?? =)
ok is this better??
int main()
{
typedef string:: size_type string _size;
string s;
um..can u explain that a little more please? my method wouldn't output the longest palindrome?
ok well this is what i came up with for printing the the palindromes:
int main()
{
string s;
while(cin >> s){
so i dont have to include "pal.cc" anywhere?
everything in my last post is my current code...i didn't change anything from that..