Is this a "do-my-homework" request ?
Please show us what you already came up with ...
Edit:: There are just so many TicTacToe examples floating around on the internet just use Google ...
Is this a "do-my-homework" request ?
Please show us what you already came up with ...
Edit:: There are just so many TicTacToe examples floating around on the internet just use Google ...
To the OP: There are much expression errors (brackets you forget) in your code, try compiling your code and you're compiler will indicate you where you've to add one :) ...
Learn how to program is exercising, the more you exercise the better you'll be, but there aren't any tricks/rules to learn how to logically solve a problem (except abstraction, where you break a problem down to several easy to understand parts) ...
sorry i'm not very good in english
but there is no actual problem but i'm talking at general
when i see a problem and want solve it by c++ how can i write the right solution to it ?
Give us an example of what problem you're seeing ...
Is this just another "please-do-my-homework" request or what ?
bool
, notvoid
and there isn't really any need to reference the parameters either.
And if you're referencing parameters and you aren't changing the parameters passed by reference it's better to pass them as a constant reference :) ...
To the OP: You forgot several brackets in your code (e.g: if( is_valid(choice)
), did you even try to compile this ?
yeah maybe it was better for geek lounge but c++ is a better way to attract Narue's attention, i am honored when i get posts from her.
Ah you think in that way lol :P
Do you want to compile a C++ program and run it from console (= command prompt) ?
I meant a Java program ...
Edit:: Can you please post your code ?
tolower() only works on a per char basis, see the man page here.
True :)
Try something like this:
void conv2lower(string &s) {
for(unsigned int i = 0; i < s.length(); i++)
s[i] = tolower(s[i]);
}
Usage:
string msg = "HELLO WoRLd!!";
conv2lower(msg); // msg contains now the string "hello world!!"
You must be using a magic compiler as your uncompression code isn't even compiling with me, look at the compiler's output:
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
tmp.cpp:
Error E2209 tmp.cpp 6: Unable to open include file 'cmpfmem.h'
Error E2090 tmp.cpp 41: Qualifier 'ffunc' is not a class or namespace name in fu
nction main(int,char * *)
Error E2141 tmp.cpp 41: Declaration syntax error in function main(int,char * *)
Error E2451 tmp.cpp 55: Undefined symbol 'insize' in function main(int,char * *)
Error E2451 tmp.cpp 62: Undefined symbol 'inpos' in function main(int,char * *)
Error E2451 tmp.cpp 64: Undefined symbol 'dicc' in function main(int,char * *)
Error E2451 tmp.cpp 67: Undefined symbol 'pos' in function main(int,char * *)
Warning W8004 tmp.cpp 84: 'out' is assigned a value that is never used in functi
on main(int,char * *)
*** 7 errors in Compile ***
What's cmpfmem.h
? (that's probably why it isn't compiling: I don't have that file)
Moderators: Don't you think this thread will be more good for the Geek Lounge.
I was also thinking that :)
On line 80 of your compressor code I encountered this: system("cls");
first: this has nothing to do with the crashes, but it isn't recommended to use the system command
(look here, this info does also apply to the "CLS" command)
As Narue said it's probably an override or out-of-bound error of dynamically allocated memory which is causing the crash :) ...
Yes, change #include <iostream.h>
to #include <iostream>
and put the instruction using namespace at the top of your code or use the std::
specifier for each object (in namespace std) you want to use :) ...
By the way: avoid using void main
it's unnecessary look here: http://cppdb.blogspot.com/ ...
can i ask an ignorant question like what is "x programming"?
>> What is X ? http://www.google.com/search?q=define:x+window+system&oi=definel&defl=en
>> X programming is programming for X (duh :P)
I think I've seen that book before, you don't have to take it seriously :) ...
I like to write my code in Notebook++.
I think you meant Notepad++ :)
Edit:: What's actually your question ? Do you want to compile a C++ program and run it from console (= command prompt) ?
Peeking is generally used for OS level programming when you need to do things outside the ordinary. Reading the character and processing it is ordinary.
Yeah, but cin.peek()
is only reading and returning the next character in the inputstream without extracting it from there ...
And this task certainly can be done easily using the ordinary techniques.
Is using cin.peek()
difficult then ?
Edit:: The cin.peek()
method doesn't destruct something when it's "peeking" ...
Why are there HTML-tags in your post, BTW, ever heard of paragraphs :P ?
It's difficult to read this ...
Please post using code tags ...
My ghod! Don't use cin.peek()! Read the line as text and process it.
We aren't allowed to use a language feature or what ?
This is actually what the OP asked for: 'terminate a while loop using a character'
>> Read the line as text and process it.
This is also an option, but as siddhant already said this is only really needed when the exit code is a character sequence :) ...
How would I merge these two functions? They have so much it common! It seemed redundant... Is there a way with templates and/or with a function that has the shared code?
Templates could be an option I think, but isn't overloading a good one ?
If this is homework, then tell us what do you think the output will be and I might test it.
[edit] on second look: I already spot one problem: 'i' is not declared, so it won't even compile
Absolutely right :)
Edit:: Avoid using exit(0);
in this case you're better off with return 0;
Is there any marks involved ?
Probably lol :P
I tried the above code. For the most part it works, the only problem I am running into is when I press "|" to terminate the program the program just spews out lines upon lines of junk.
I don't understand what you mean, can you please post the code where you're having this problem with?
It should work fine :)
> case 2:Cal_semester_Grade();
You declared the Cal_semester_Grade(); to expect a pointer to a char so you need to pass it also :)
> You're declaring function void menu()
inside the main function, function declarations in functions aren't allowed in C ...
> Cal_semester_Grade(char studname[][30]);
this gives you an error
> Hope this helps :) !
> Did you try compiling a program in the same way as you did before?
> Did it work?
Maybe you should take a look at the makefile of the 'demo.exe' program and see what options are specified there do let the program compile :) ...
Yes I tried to compile an existing program.
And did it compile or not :?:
I also found both of those sites and neither of them told me what I need to know. Specifically which linker options to set
The linker options are probably the same or am I wrong ?
Sure we can help you, post your code, ask questions about what you don't understand and we'll help you out, but remember one thing: we aren't doing any homework for you :), we're just helping you to understand things, in that way you'll become a much better programmer than just copying someone else's code :) ...
need help with everything dont realy know where i should start
Split the problem down in several parts which are each easy to understand (this process is also known as abstraction), create a plan before you actually go onto the coding part ...
I would suggest to get a book rather than relying on tutorials.
Yeah, I would also do so, books are often much better to learn a programming language, but that's just my personal opinion ...
Further I can recommend you 'C++ Black Book' (by Steven Holzner) and 'C++ Beginners Guide' from Herb Schildt (you can get a free ebook copy at Microsoft's site: http://msdn.microsoft.com/en-us/beginner/cc305129.aspx
, a very nice book :) )
#include <..//Folder_Name//File.h>
I think this should work out.
You need to traverse to the previous directory and then to a sub-directory.
Using '<' and '>' works only if the header files are in the compiler's header files directory ...
Probably the simplest way to go:
#include "../projectBfolder/B.h"
or add the project B folder to include paths list of the project A. How to do it depends on your IDE, of course...
This should work fine :) ...
Just make sure you download it from the official site, some mirrors put viruses on it (snapfiles for example)
And I who thought it was a safe mirror :P ...
Your code is just overkill !
I know a better one (this one has no errors :P): http://www.daniweb.com/code/snippet898.html :) ...
Was there something more difficult ?
Davidhoria and Narue are right :)
By the way, did you try searching Google ?
Please post using code tags, by the way: what's your problem as you didn't tell me :) ...
What about something like this ?
#include <iostream>
using namespace std;
int main()
{
char chr;
while(cin.peek() != '|')
{
cin.get(chr);
cin.ignore(1000, '\n');
/* Put your code here */
}
return 0;
}
To the OP: Please post using code tags in future ...
Well jellybean is OSS (hosted on sourecforge) so you would think someone would notice if it was malware...
If this is true then my antivirus is reporting me a false-positive ...
Now I'm convinced it's 1000% virus clean :) !!
OK I'm marking this thread as unsolved because I can't find anywhere how to set up allegro 5 (eg. which files to include, which functions have changed and which linker options to set). I'm trying to get it up and running with Code::Blocks and MinGW. Thanks in advance.
Have you tried to compile your existing code ?
Litterally just from the homepage: http://www.talula.demon.co.uk/allegro/changes.html
For the API: http://alleg.sourceforge.net/a5docs/refman/index.html
Was it that difficult ?
LOL, i haven't seen that p01.cri had changed. That's why it kept crashing. On the info it says that creates a file named result_filename.cri, that's not true, using these commands, it gives the result on the input file.
Thanks again guys.
OK, I've changed the code and it should work now :) ...
To the OP: Can you please post using code tags ?
Can you show us what you've done so far?
We're not making your homework ...
Please post using code tags, can you also please tell me what problem you're having ?
Yeah they do, if you use the MS Deployment tools (sysprep, the unattended install toolkit, etc...) and/or the WIM toolkit, they are fully supported for deploying clients in the enterprise, but only on the pro (retail or VLK) and server versions.
Agreed, but I was talking about the nlited editions :)
But it doesnt really matter. No one ever gets MS support anyway
That's true !
Actually it should work, I tested it with the 'p01.cri' file which was in the fileset and it was working ...
Syntax: tabu_sdvrp [I]filename[/I].cri [I]random_number[/I]
according to my AVProgram its loaded[4 nastie files deleted maybe faulse but keyfinder didn't work ] with trojans !
It's working with me, btw, I suggested this because my AV flags MagicalJellyBean Keyfinder as a virus/trojan :) ...
Any other questions ?
void Class_Grade() { int grade1,grade2,grade3,gradeavg; printf("Please enter Class grade"); scanf("%d%d%d",&grade1,&grade2,&grade3); gradeavg=(grade1+grade2+grade3)/3; }
so this is how its done?
Yeah, syntactically this is a correct function, but you forgot one thing: if the function is ready with it's execution what happens to the value in gradeavg? It's lost ...
The gradeavg variable in this function isn't the same one as the one you declared in your main function, this is another one, the name is the same, but it's another one :) ...
Edit:: For more information on this: http://irc.essex.ac.uk/www.iota-six.co.uk/c/d5_variable_scope.asp