134 Posted Topics

Member Avatar for muzhe

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 …

Member Avatar for Ancient Dragon
0
813
Member Avatar for AirGear

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.

Member Avatar for necrolin
0
114
Member Avatar for licktress

[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" …

Member Avatar for Protuberance
0
261
Member Avatar for khakilang

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 …

Member Avatar for khakilang
0
138
Member Avatar for himgar

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 …

Member Avatar for necrolin
0
104
Member Avatar for darkelf94

It won't work on any computer that doesn't have the .Net framework installed. That's an easy download from microsoft.com.

Member Avatar for GeekByChoiCe
0
89
Member Avatar for mandofl
Member Avatar for xfngrn13

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 …

Member Avatar for VernonDozier
0
126
Member Avatar for sara9111

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 …

Member Avatar for mrnutty
0
129
Member Avatar for licktress

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 …

Member Avatar for JasonHippy
0
95
Member Avatar for gopi17

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 …

Member Avatar for necrolin
0
152
Member Avatar for D.JOHN

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 …

Member Avatar for D.JOHN
0
141
Member Avatar for agaba

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.

Member Avatar for mrnutty
0
103
Member Avatar for adelphe

[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 …

Member Avatar for adelphe
0
167
Member Avatar for khakilang

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 …

Member Avatar for khakilang
0
101
Member Avatar for veledrom

[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 …

Member Avatar for veledrom
0
113
Member Avatar for jempag

[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 …

Member Avatar for necrolin
0
210
Member Avatar for scarypajamas

[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 …

Member Avatar for necrolin
0
110
Member Avatar for dasatti

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.

Member Avatar for dasatti
0
184
Member Avatar for mcco1

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. …

Member Avatar for zautner
0
122
Member Avatar for frustratedpc

[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 …

Member Avatar for jholland1964
0
350
Member Avatar for mediachicken

[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 …

Member Avatar for necrolin
0
127
Member Avatar for calavan11

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 …

Member Avatar for calavan11
0
128
Member Avatar for cougarclaws

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") …

Member Avatar for cougarclaws
0
135
Member Avatar for sdmahapatra

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 …

Member Avatar for Laiq Ahmed
0
226
Member Avatar for umairraja52

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 …

Member Avatar for ThinkFree
0
153
Member Avatar for shakil_diit

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 …

Member Avatar for shakil_diit
0
146
Member Avatar for Denxerator

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.

Member Avatar for jencas
0
150
Member Avatar for fuzzyrose

[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 …

Member Avatar for necrolin
0
121
Member Avatar for kou yuuzhen

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 …

Member Avatar for necrolin
0
164
Member Avatar for stockton
Member Avatar for necrolin
0
109
Member Avatar for yara naser

[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??!! …

Member Avatar for necrolin
0
176
Member Avatar for samanaonline

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 …

Member Avatar for samanaonline
0
632
Member Avatar for Cloneminds

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) …

Member Avatar for wildgoose
0
226

The End.