134 Posted Topics
Re: Here's another example. Almost the same as Ancient Dragon's. [code] #include <iostream> #include <cstdlib> #include <sstream> #include <fstream> using namespace std; int main() { ofstream outputFile; string filePrefix = "file"; string fileSuffix; string fileName; stringstream convert; for (int i = 1; i < 5; i++) { //Convert integer to string … | |
Re: Do you mean you want to execute commands such as dir from within your C/C++ program? Sure. system("dir"); Just change dir to the name/location of any program you want. The output will go to the screen though, not back to your program. | |
Re: [QUOTE=licktress;944367]Uh... pardon?[/QUOTE] You used: cin >> cFolder; If you type: "my folder name" then the value stored in cFolder will only be "my". The words "folder name" will be in the buffer. If you want to read the entire line then use getline instead: getline(cin, cFolder); Which is what "iamthwee" … | |
Re: You'll have to compile the kernel on your machine. It takes about an hour on my laptop. On top of that you may have to rebuild some things like the nvidia driver, etc. It's a bit of a pain in my opinion. But, if you really want/need to do it … | |
Re: conio.h isn't a part of the C/C++ standard. It was included with about 3 compilers and was implemented differently between each. I would recommend: a) Getting a newer compiler. Turbo C++ was made for DOS/Win 3.1. Something that was made for Win 3.1 just doesn't cut it. If your machine … | |
Re: It won't work on any computer that doesn't have the .Net framework installed. That's an easy download from microsoft.com. | |
Re: class.function() So it's: first.Accelerate(); | |
Re: You're trying to use 2 arrays num[] and num2[] that you never created. Also, where are the values for num[] supposed to come from? Array Example: [code] //Create an array int salary[10]; //Assign values to the array //You can do this as part of a loop or whatever you want … | |
Re: 1. You have a function prototype 2. You have a main function that only prompts for an integer, you never call on the function so it's never executed 3. You have a function that never gets run. You need to call the function, for example: num = reverseDigit(98); Here num … | |
Re: C++ executables can't be executed on "another" OS. So an executable that you compiled in Linux won't run in Windows and vice versa. This is widely advertised as one of the strong points of Java... compile once run anywhere with a JVM. Also, if I remember correctly then some processor/hardware … | |
Re: If you only pass one parameter to the function then what's the program supposed to do with the other 8?? Besides, regardless of the name of the variable that you're sending the data will go to the first parameter in the function. So basically you're sending row1col2 to row1col1... which … | |
Re: There's a few issues with your file. [code]void main[/code] If you're using C++ then main has a return of int not void. Also, you forgot the "()" at the end. So it should be: [code]int main()[/code] The following compiles and works fine on my system: [CODE] #include <fstream> using namespace … | |
Re: I don't mind helping you out but you're not asking for help. You're asking someone to do your homework for you. Try it out on your own. Show us the source code you have and we'll help you fix the mistakes. | |
Re: [quote]what if the file i am writing and reading to does not exist? this is what i am try solve or asking for help.[/quote] ifstream is for reading from a file (input) ofstream is for writing to a file (output) fstream is for reading & writing from a file, however … | |
Re: Try to play your MP3 files with Totem. It should automatically suggest installing the plugin and install it for you. If this isn't happening then do the following: a) Under the menu: System -> Administration, find the program labeled "Software Sources" and enable "Software restricted by copyright or legal issues … | |
Re: [URL="http://www.virtualbox.org/"]VirtualBox[/URL] You can create a virtual machine and install Ubuntu inside Windows or vice versa. This way you can run 2 systems at the same time. What I did was I used OpenSolaris for the entire drive, installed Windows inside VirtualBox and never need to reboot. Note that this will … | |
Re: [QUOTE=jempag;932055]can you please help me how to use [COLOR="Green"]function and about function calling?[/COLOR]please give me some easy tip! thank you very much![/QUOTE] Functions can be called anything you want. Your question usually takes up a 50 page chapter in an average book though... so it makes it difficult to answer … | |
Re: [QUOTE=scarypajamas;931536]There is no code, I'm just wondering why it does this sometimes? Is it because my float values are too big? Is it something with the math? What does it actually mean anyway? In my number, -4.49255e+013, does the "e+" mean the actual value is to the 13th place?[/QUOTE] It's … | |
Re: You can only have a maximum of 4 primary partitions. If the partitioning program is crashing then I'm assuming that you've reached this limit. Try moving all of your data off of one of these partitions and then using that partition for Linux. | |
Re: You say that you have found out how to download a file, but that this isn't what you need. I would argue that downloading the file would be a good start. Once the file is on your computer you can read/write to the file very easily using ifstream and get. … | |
Re: [QUOTE=jholland1964;910184]You should have waited for an answer in this thread rather than making another thread. I posted the answer [B][URL="http://www.daniweb.com/forums/thread202074.html"]THERE[/URL][/B] If this helps then please come back to this thread and continue with your problem. Don't post back in that one.[/QUOTE] How can he navigate to the control panel if … | |
Re: [QUOTE=mediachicken;928770]So I know I can run a terminal command, ok? What if I want to run say... a vi command or mkdir command INSIDE ssh? If I want to make it insert a directory in a server via SSH, possible? Last time I checked I think when you run commands … | |
Re: Why don't you make both your max and min equal to the first value in the array? Originally you initialized them to zero. Well, how about when all numbers are less than zero?? Doesn't work. If you initialize them to the first value in the array then your program will … | |
Re: You need braces. [code] if (gender == 'M' || 'm') { if (...) do something else if(...) do something else do something else } [/code] The problem is that if (with no braces) only sees the next line that follows it. So if you do this.... if (you == "boy") … | |
Re: Do you specifically need to use the base class instead of the derived class? I was taught that you derive classes to add functionality to a base class. After which you use the derived class instead of the base class whenever you know that you will need the extra methods … | |
Re: It depends on what you really need to do. If you need something very basic then there is Bluefish, which I can describe as a text editor on steroids. If you need more full featured there's always [URL="http://www.aptana.com/"]Aptana Studio[/URL]. This one is meant to be a full IDE with support … | |
Re: Pop the RedHat disk back into the drive and there should be a "rescue" mode somewhere in the setup. This will bring you to a command prompt (looks like DOS). You'll want to do the following: Type "grub" to enter a utility where you can repair/install grub then... a) type … | |
Re: My advice would be to get an introductory level book. Then download code::blocks (an application that helps you write programs) and start working on code. Do the exercises in the book you get and try to come up with your own interesting programs. In programming you definitely learn by doing. ![]() | |
Re: [QUOTE=slacke;906140]If you want to queue your processes as they arrive you can use the fork() to create threads for each process.[/QUOTE] Correct me if I'm wrong but I was under the impression that fork() creates a child process, not a thread. It basically creates a duplicate or clone of the … | |
Re: I wrote a few "Leap Year" programs in school. I always used tests like (year % 4).... which checks if the year is divisible by 4, and considering that leap years occur every 4 years then this is a good starting point. The exact definition that I used was from … | |
Re: cout << "Paused...." << endl; cin.get(); This will wait until the user hits "enter". | |
Re: [QUOTE=yara naser;916732]please can you help me to translate this code from c to c++ /*************************************************************** Program describtion : ===================== This program is for creating a Lexical Analyzer in c Created by : ============= CoMPuTeRQ8 kuwait university Major : COMPuTeR-SCIeNCe [/QUOTE] Are you asking us to do your homework for you??!! … | |
Re: Do you mean something like this (VBA)? [code] Sub HelloWorld() Dim a As String Dim b As String a = "Hello World" b = a ActiveCell.FormulaR1C1 = b End Sub [/code] You can also use your string variable in a MsgBox. The simplest example being: MsgBox(b) Of course you can … | |
Re: To make your assignment work you need to be able to pass data between your functions and the main program. To do so requires one of two things: a) A return statement... meaning the functions can't be void. That's not part of the assignment so let's forget about this. b) … |
The End.