Advertisement

Another prob for me.

Started by January 15, 2002 06:04 PM
9 comments, last by StoNeD_TrOLL 22 years, 11 months ago
When i run my project i only get the output of one of my files.How do i get the output of the rest like i should?
You really need to be more descriptive when you post. Simply saying "my program is broke, how can I fix it" is not nearly enough info. You can start by telling us what your program is attempting to do and what language it''s written in. What are the output files you are creating/writing to?

I saw some of your other posts, and there seems to be a pattern of you not giving enough information. If you want to ask for help, that''s fine, but try to give enough info for someone to help you.

Jason
Advertisement
quote: Original post by StoNeD_TrOLL
When i run my project i only get the output of one of my files. How do i get the output of the rest like i should?

well, you either have a problem with the logic of your program (go through it line-by-line and think through what exactly the computer is supposed to be doing, and if that line of code does whatever that is), or you need to diddle the settings on your thingamabob.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Okay its like this:There are three files.Lets just say ones output should be "HI" anothers"Im sick" and anothers"Bye"
Basicly all my files just say something.And so my first file would be the won that says"HI".So i go run my project and get just the ouput of the first file,but i should get the output of files 2 and 3.So how do i do that.Oh yah,its written in c++.
dude, if you want a real answer you''re going to have to be REALLY specific. i.e. what is the output? are you writing 3 files? or reading 3 files and printing them to screen? that is not clear from your post... either way, how are you doing this (input and output)? it would be best to show the relevent parts of your source code at least, if you can''t exactly describe what is going on.
or, you could follow the advice i gave you in the last post (about checking your logic in the program)...

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Look,i have three files,all they do is say something then that file is done. And when i run my program i get the ouput of one file wich is "Deleting files"+10000more basicly.And the two others just say like hi and bye.I should have there output too because i ran the whole project.
Advertisement
Show us the code.

Invader X
Invader''s Realm
I think the reason you are not getting many good replys here is that in C++ you don''t just "get output" from three files. Now if you have declared functions within three different files, and you are calling them from your main() function (I''m assuming this is a console based since it wasn''t specified) then we may be able to get somewhere. Also, not quite sure what you mean by "ran the whole project." Does that mean that the three cpp files (assuming they are cpp files again) are in one project and you are compiling the project, or does that mean you ran the exe. And what kind of error message, if any, does it return when you run your program? Just try to be as specific as you can when you describe the problem. Even if it ends up being 100 lines of explanation, more is better when it comes to describing a problem.

Always remember, you''''re unique. Just like everyone else.
Always remember, you''re unique. Just like everyone else.Greven
Since this is a "For Beginners" forum, I''ll type slowly and be polite:

RTFM.

Now, that said, you don''t need a file per function in C/C++. Files do not produce output - functions do. Start from the bottom and keep to a single file until you understand what you''re doing. Here''s a very simple C program that has three functions that output "Hi", "I''m sick" and "Bye":
#include <stdio.h> // I/O prototypes//// these are your functions you want the main() function to know about:void print_hi(){  printf("Hi!\n");}//void print_sick(){  printf("I''m sick.\n");}//void print_bye(){  printf("Bye.\n\n");}//int main(void)        // starting point of your program{  print_hi();         // transfer control to output "Hi"  print_sick();       // ditto "I''m sick"  print_bye();        // "Bye"  return 0;           // end the program and "return" to the OS} 

Note that this is just ONE file. Expand and experiment from here.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
what, are you afraid that someone will steal your wonderful code?!
look, if you are typing then you are at your computer, so cut-n-paste the code. people here are always willing to help out, but not if you make them guess what you want to know!

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])

This topic is closed to new replies.

Advertisement