huzzah it works! thanks guys...
int main()
{
int length;
char capital;
char text[]="this is some text";
char space[]=" ";
char *result=NULL;
Type: Posts; User: suzumebachi
huzzah it works! thanks guys...
int main()
{
int length;
char capital;
char text[]="this is some text";
char space[]=" ";
char *result=NULL;
ahh.. i was using string.h :)
e:\dev\textfile\textfile.cpp(36) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class...
How would you drop or ignore the first character of a string? For example, you have a string that says "Spaghetti" and you just want "paghetti".
whoa. flush; worked like a charm. thanks a bunch guys.
www.cppreference.com has a pretty good list of standard library functions, if that's what you mean.
#include <stdlib.h>
#include <time.h>
#include <iostream.h>
#include <string.h>
#include "Console.h"
namespace con = JadedHoboConsole;
inline void drawline(int length)
{
ok... so it's a portability issue. but what about the goto?
ok, it's working now. the code's still kinda messy though.
here's what I have now:
// Health Fair
// Created by Ty Guenley
// 02-09-05
#include <iostream.h>
o.O ??????
I don't understand why everyone hates goto so much (maybe it's because I'm used to QBasic and batch files?). And I also don't understand what's wrong with void main() for a simple program. :o
As...
ok i think it actually is calling the weight() function, it's just clearing so fast i can't see it (it never pauses for input or anything, so it flashes for a millisecond and returns to the menu).
...
I think if and else if is going to work better than switch in the menu because after the function returns, it's moving straight to the next case for some reason.
Edit: Tried that, and it doesn't...
wait, i discovered what was causing return not to work. i removed the break after the call to bmi() in main(). but now it's going straight to weight().
working on it...
When I change <iostream.h> to <iostream>:
--------------------Configuration: healthfair - Win32 Debug--------------------
Compiling...
healthfair.cpp
c:\cs151\healthfair\healthfair.cpp(35) :...
1. You didn't include iostream. Fatal error.
2. You defined main() as an integer and didn't return a value.
3. You had invalid escape sequences. (n\)
4. You had invalid operators. (=>)
5. You...
well, it apparently doesn't matter whether I call it main() or not, I get the same error anyways. :/
thanks for the reply though. :)
First off, I'd just like to point out that I'm quite new to C++. Anyways, I'm trying to make an inline function return to the main function if a switch case is met. The compiler error is as...