2,827 Posted Topics
Re: Assuming inputFile is type string, looks fine to me. I assume the file actually exists and the permissions are correct, file is available, etc.? To narrow down the bug, try hard-coding the filename. See if it makes a difference. [code] infile.open ("input4.txt"); [/code] But here's a thought. Why are you … | |
Re: Lines 36 through 39 can be deleted. They have no impact. Line 36's condition will ALWAYS evaluate to false. If you have a command like "show automobile", then line 31 will be false since "show" is not the same as "show automobile". I imagine you perhaps don't want to use … | |
Re: Glad you solved it. Do yourself a favor and indent. It makes things WAYYYY easier. NetBeans and Visual Studio both have code formatters. You'll spot things so much faster! | |
Re: One, use code tags. [noparse] [code] // paste code here [/code] [/noparse] Two, you need to use a nested loop: [code] int i; int j; int someNumber; for(i = 1; i < ??; i++) { for(j = 1; j < ??; j++) { someNumber = ?? * ??; // display … | |
Re: I'd say don't include it unless they ask for it. They may have a very specific format of how they want it. Follow that format to the letter if it's provided. Otherwise, if they ask for a resume and a cover letter, just give them that. An attachment might not … | |
Re: [QUOTE=Fadam360]Hello everyone, I need to make a program for Java...[/QUOTE] You're in the wrong forum then. Please mark this solved and start a new thread in the Java forum. Thanks. | |
Re: You say you removed some of the code. You clearly did, but you removed too much. What's the prog[] array? Way too many goto statements here. I'm not one of those purists who insist on no goto statements, but there needs to be a really good reason and all it … | |
Re: In addition to what StuXYZ said, I suggest using smaller test cases than 777 and 7777. It'll break at 9, calling it prime. That's because, as StuXYZ mentioned, due to the break statements, you don't really have a loop and thus don't test for anything higher than 3. | |
Re: Programming is a big field. Should you learn C++? It depends. Most people end up specializing. A big fork in the road is interpreted languages (Python, Perl) versus compiled languages (C, C++, Java). It's obviously useful to know both. Then there's web-based languages (PHP, Flex) versus non-web-based languages. And there's … | |
Re: >> I got it to work with the arrays, but I can't figure out where to do the changes so that an vector can accomplish the same thing. ????????? This doesn't compile. In particular, lines 8, 18 and 37 don't match: The initialize function expects an array, but you give … | |
Re: Figure out how you do this in real life on pencil and paper and then turn the equations into code. You need to use the .90, .65, and .70 in some equation somewhere, right? | |
Re: Nobody can force you to get "baked" and no one can force you to post when you are "baked". There are plenty of "crowds" out there that don't drink, smoke, or go out clubbing, and plenty that do. Now that you are an adult, you can pick your own crowd. … | |
So I have opened a file with the "open" command and I get a file descriptor. That means I have to use lseek rather than fseek, which is fine by me. But what if I want to know how long the file is or what if I want to know … | |
Re: a.out is the executable program's name when you don't specify a program name. You can't run an uncompiled C++ program. You can only run something that has been compiled into machine code. You compile with the g++ command. You start with a C++ program like you have done. Let's say … | |
Re: First, you can use the "system" command", but it's generally frowned upon. Normally you use "execvp", execlp", or something similar, after forking, piping, or whatever. Use the Microsoft equivalent. The system command is doable, but keep in mind the lifetime of the process and where stdout goes, etc. The system … | |
Re: >> what should be the first step? The first step is to figure out exactly what you want. If you don't know exactly what you want because you don't know what's available, then the step before this step is as the last poster mentioned. Study Java Swing, particulary the Layout … | |
Re: I don't see anything in the rules where it explains how/why to use code tags and other BB-Code correctly. That should be added IMO. | |
Re: [QUOTE=lonely_girl;740635]Heyyy Thx alot!!! it worked without any errors but it was not giving any output....the output screen exits without giving output....[/QUOTE] Nick, Did you create the lonely_girl profile just so you could post your Mickey Mouse program and this response? Regardless, +rep to both of you, if there are two … | |
Re: Too many string here. A keys string and a grades string are sufficient. No need for all the substrings. Just do this: [code] if(key[i] == grades[i] { // right answer } else { // wrong answer. } [/code] You'll need at least an array of integers to keep track of … | |
Re: Get the cout statement out of the do-while loop. If you want to display tempArray, do it after intToBinaryString has finished. A function should convert or display, but not both unless there is a reason IMO. Either use itoa or use a loop, but don't use itoa inside a loop. … | |
Re: [QUOTE=mrrko;687646]Someone?[/QUOTE] Please repost with code tags. Looks like at least part of your program got cut off. [noparse] [code] // paste code here [/code] [/noparse] | |
Re: You need to format your code. It is impossible to read. If this is a multiplication table, why do you want the user to input the cells? Values will be from 0 or 1 to numRows or numCols. Regardless, you create a dynamic 2-D array like this: [code] int numRows, … | |
Re: [QUOTE=churva_churva;1316554]sorry im just new here i dont know the rules[/QUOTE] Then READ the rules. They're right next to the logout button, at least some of them. Two possibly aren't there: [LIST=1] [*]One open thread per topic. [*]Don't PM people for help. Just post on the public forum. [/LIST] Read this … | |
Re: You have a file. You have variables that you have to read that file into. Your job is to write code that matches the file layout and the variables. getline and eof() are tools. Depending on the file layout, they may or may not be the right tools. If you … | |
Re: The post count nickname formula list is deliberately not posted. They figure it would be too boring if everyone knew. But you could probably go through different members' post count along with the nicknames and quickly establish an accurate, though possibly not exact, post-count-to-nickname formula. | |
Re: [QUOTE=Vivek Venkatesh;1312640] Can anyone say me which one to use considering the fact that My Project should implement most of the Word Processing Features.....[/QUOTE] That's an AWFUL lot of features. Think of all of them: Let the user specify fonts, embed all sorts of graphics in the document, save in … | |
Re: [QUOTE=Chosen13;1312948]Hello, Me and my development team are not sure how to get a users username/uid from their login on the website into the C++ application. I use PHP Cookies and Sessions for that. Is there anyway that this could work? Thanks.[/QUOTE] On the server side, you can use the "exec" … | |
Re: Quotes are always nice too. But I think bloody_ninja had his tongue firmly in cheek with that post. Hence the :D avatar. Also let me be the first to point out that this thread started in 2005, then was revived in February, then again in April, then again today (I'm … | |
Re: [QUOTE=apple621;1185010]Write a function whose prototype is string NumberToName(int x); that returns the string of english name of each digit of number x. Using this function, write a main program that reads a positive integer number and prints the english name of each digit of that number in a single line … | |
Re: The vast majority of these errors: [quote] Error 1 error C3872: '0xa0': this character is not allowed in an identifier \\ilabss\home$\D03279277\Documents\Visual Studio 2005\Projects\Lab6Ex2\Lab6Ex2\Lab6Ex2.cpp 37 [/quote] have nothing to do with the code you posted. I just copied and pasted into Code Blocks and didn't get any of the '0x0a' errors. … | |
Re: It worries the heck out of me too. Anything that can be programmed to provide safety can be abused maliciously, particularly by the people who are "authorized" to develop/use the code. What if someone decides it would be a fun prank to turn all the traffic lights green at the … | |
Re: I put in a lot of cout statements, like: [code] char c[3]; cout << "Got this far\n"; c[0] = 'H'; cout << "Now I'm this far! Cool.\n"; c[1] = 'e'; cout << "Hot damn! I'm this far\n"; c[2] = 'l'; cout << "Oh yeah! Stylin'. I'm here!\n"; c[3] = 'l'; … | |
Re: [code] System.out.println("firstVar is " + firstVar + \n"); [/code] You need an even number of quotes inside the parentheses. You're doing println, so it adds a newline character. Unless you want two of them, leave the '\n' off. firstVar probably needs to be converted to a string before adding it … | |
Re: [QUOTE=cwarn23;1083498]I think the main problem here is that there are theories that contradict. Some of your theories contradict my theories and as I see evidence I choose which is best. However the main theory which is making this thread a mess is that everything on the periodic table is made … | |
Re: Does anyone but me not trust Michael Reagan to decide which of our e-mails (i.e. ALL of them) need to be automatically turned over to the FBI, CIA, NSA, etc. for "national security" reasons? They probably wouldn't even have to subpeona them. Michael Reagan would do a massive search for … | |
Re: [url]http://en.wikipedia.org/wiki/Reference_%28C%2B%2B%29#Relationship_to_pointers[/url] | |
Re: Line 41 - It looks to me like you have an "if" statement instead of a while statement when you are replacing the correctly-guessed letters. You need a while statement if you want to replace ALL the instances of a letter You also appear to be missing a closing bracket … | |
Re: [QUOTE=bakizzy;1297289]hi everybody!!! im new in developing systems using java.. i want to develop any system i need help. i dont know what to do. if you have any idea on what i can do please help..[/QUOTE] Way too vague. If you don't know Java at all, start with Hello World, … | |
Re: [CODE=C++] struct Appoint { string place; string title; int hour, minute; int durationHr, durationMin; }; struct TreeNode { Appoint app; //The data in this node. Is this possible to put in here and use? TreeNode *left; //left subtree TreeNode * right; //right subtree TreeNode(Appoint temp) { //Constructor defined. Do i … | |
Re: [QUOTE=David_Omid;1296558]Hey, sorry if this question is really really simple and silly to ask here but I can't find a suitable answer anywhere else and nobody out there so far is willing to help me out so any help would be greatly appreciated. Simple thing I want to do: I have … | |
![]() | Re: [QUOTE=aakaashjois;1005006]hello guys, Can any of you help me create a game in java?? There has to be two paddles, one at the top and the other at the bottom. The paddles have to stop the ball from getting out of the screen. The ball cannot leave the screen from the … |
Re: [code] #include <stdafx.h> #include "genlib.h" #include "simpio.h" #include "math.h" int _tmain(int argc, _TCHAR* argv[]) { int i,nam,lim; for (i=50;1<=100;i++) nam=i; lim=sqrt((double)i)+1; for (i=50;i<=lim;i+=2) printf("%d",i); }[/code] Here is your code, with brackets and consistent indentation. [code] #include <stdafx.h> #include "genlib.h" #include "simpio.h" #include "math.h" int _tmain(int argc, _TCHAR* argv[]) { int … | |
Re: Before you can control the other programs with your C program, you need to know if they are controllable and how to control them. If they are controllable by passing them command line arguments and running them and that's all you need, any command you can make from the command … | |
![]() | Re: [QUOTE=Ancient Dragon;1270502] Many people have been killed with knives, pitchforks, and all sorts of objects.[/QUOTE] But mostly with guns. [url]http://www.fbi.gov/ucr/cius_04/offenses_reported/violent_crime/murder.html[/url] [quote] Weapons Of those incidents in which the murder weapon was specified, [COLOR="Red"]70.3 percent of the homicides that occurred in 2004 were committed with firearms[/COLOR]. Of those, 77.9 percent involved … |
Re: [LIST=1] [*]Get the count [*]Calculate the sum [*]From the count and the sum, calculate the average. [*]From the average, get each deviation (error). [*]Square each deviation (squared error). [*]Add up the squares (sum of squared errors). [*]Divide by (count - 1) (mean squared error. count - 1 is degrees of … | |
Re: I agree that the first response to the thread was too severe. The OP of that thread, judging by his other threads, does not appear to be a "Give me teh codez" type of poster. That particular thread had a starting post that did not demonstrate effort, which doesn't mean … | |
Re: [code] if (code==1){ total += rv;} else { [COLOR="Red"]sumD += 1.0/rv;[/COLOR]} } if (code==2){ [COLOR="Red"]total += 1.0/(sumD);[/COLOR]} [/code] Both red lines of code execute when code == 2. Is this what you want? | |
Re: To 1stDan, Voting and rep are entirely subjective. You can't find out who down-voted you, but you can find out who gave you bad rep by going to your control panel. Perhaps the person who down-voted you felt that you should have posted a specific link originally rather than just … | |
Re: [QUOTE=Rickay;1279718]Thank you, I actually figured that out about a minute after posting that hehe... but another question along those same lines if thats okay. How can I use an if statement to decide whether the input is a character or an integer? [CODE]if(x == char) //code here... if(x == int) … | |
Re: [QUOTE=interist;1279702]Hello all, how can I pass some input from Java ti C++ using sockets. The input is only two int numbers. Any help with the sockets, please. I'm new but I need them.[/QUOTE] If you can pass info using sockets between two instances of a Java program and if you … |
The End.