5,676 Posted Topics
Re: [quote=LegerdemaiN;261880]How can I get a program to find and extract an email adress from a line and replaces the @ sign with 'AT'? [/quote] 1) Search for the @ 2) test characters after the @ for valid domain name construct. Memorize the first position that doesn't fit. 3) test the … | |
![]() | Re: Depends on what you want to do. If it's just more of the same, as long as you didn't use non-standard Borland functions, your old code should compile fine. |
Re: See [url=http://www.ztwrc.com/tiki-index.php?page=NetDrive]this[/url]. IMO it make this FTP stuff much easier. The FTP site simply becomes a drive on your computer. I use personally use Webdrive. | |
Re: [quote=Anonymusius;261215]You have included header.h twice (In both files). Use some sort code like of this (might be C++, sorry) [code]#ifndef HEADER #define HEADER #include "header.h" #endif[/code] But I dunno wether that is the real problem[/quote] I don't see that problem at all. There is only one include in each .c … | |
Re: [quote=zac_haryy;261473]So what type of code would I have to write to make this work?[/quote] C or C++ might be a start. I can't believe this is your first program in the class so you should be able to do at least part of it. Then when you post something that … | |
Re: [quote=vegaseat;261458]Take a look at function fscanf() that delimits on whitespaces. Nothing wrong with using it in C++, it is part of ANSI C++.[/quote] Nothing wrong with it but totally unnecessary. [inlinecode]cin[/inlinecode] is just C++'s version of [inlinecode]scanf()[/inlinecode]. And there is no reason to read from a file using [inlinecode]fscanf()[/inlinecode]. | |
Re: [quote=vheart20;261332]i want the whole project fully finished do u ahve one where u could send me one[/quote] How much time will you give me to develop it? Are your specification complete enough for me to quickly code the project? How much is your grade worth to you? It's going to … | |
Re: Where did you take the total sold and calculate the total price? Shouldn't that be in each [I]case[/I] statement? Also, at the beginning of your [I]do[/I] loop, you should ask only 2 questions: 1) What product was sold (A-E): 2) How many sold: The your [I]switch[/I] value would be the … | |
Re: In general, you have to read all three colums, and just igore the first 2. | |
Re: Actually, you read from one file, then write to another file. You don't want to read and write to the same file. It gets too complicated. | |
Re: [quote=~s.o.s~;260710][quote=Inanna;260451] 0 doesn't represent a digit.[/quote] Well thats news to me :cheesy: (maybe you wanted to say that 0 doesnt represent true condition )[/quote] I'm with [B]Inana[/B] here. 0 does not represent a digit, it represents a binary 0. '0' represents a digit. A digit is an ASCII character, therefore … | |
Re: [quote] Properly formatted: [code] if (((strcmp(ptr,"int")) || (strcmp(ptr,"float"))) == 0) [/code] [/quote] No it is not. That does not work. Example: [code] #include <string.h> #include <stdio.h> int main(int argc, char* argv[]) { char *ptr = "float"; if (((strcmp(ptr,"int")) || (strcmp(ptr,"float"))) == 0) printf("Yes\n"); else printf("no\n"); return 0; } [/code] ![]() | |
Re: [quote=johnnyrocket;259441]I've placed a CSV file into an array with C++ with each row being a single array element, but the file contains many, many columns that I don't need. I only need columns 1,2,3,4,6,7 out of about 50. Is is best to read the full value into the array and … ![]() | |
Re: [quote=phuduz;259967]thnx a lot for all urguys help i really appreciate it![/quote] Yeah, where were you guys when I was learning to code? I could have partied more and let [I]you [/I]do my home work for me, too! :rolleyes: | |
Re: In other words: You have 3 files 1) Data File -- what reads the data file? 2) Program -- calculates data from the file. How does the data get into the program? 3) Script file -- somehow runs the program and associates the data with the program. This depends on … | |
| |
Re: [I]straight()[/I] is a terrible function. What about something like [code] isStraight=true; for (i=0; i<8; i++) { for (j=0; j<5; j++) { if (hand[j+1] != hand[j]) { isStraight = false; break; } if (isStraight == false) { break; } } } [/code] Of course modified for your design... | |
Re: [quote=tlly;259444]Hello...I need to write a program where i need to copy each word of a string into an array... Eg(string s="hello how are you" arr[0]=hello,arr[1]=how....). any help:?: ??[/quote][quote=tlly;259455]Thanks mate...but i need the solution in c++...is it posible??...sory for not specifying this at the start[/quote] In other words, "[I]Thanks, but I … | |
Re: [quote=andor;259287]PS: Don't post the same question twice ;)[/quote] And please start using code tags, and posting with titles that have some meaning -- like a short description of what the program is about. | |
Re: [quote=whitemoss]Hi WolfPack, ok..I've got what do u mean..and I already try it n it works..but..I still need to type the filename right?..If possible, I just want to run program.exe only but then it can read all the files inside the same directory. [/quote] This may not be necessary. If you … | |
Re: [quote=LieAfterLie;258817]How would i specify a Win32 project in Dev-C++? All that's listed is console, windows app, static library (.a), DLL and empty project.[/quote] Win32 == windows app | |
Re: Yes, this question belongs in Software development -- IF you are trying to develop the code yourself. If not, just use a calculator. | |
Re: [quote=Ancient Dragon;258123]Arrays must have a name. [/quote] Not in a prototype. Onlyt the [I]type[/I] of the parameter is needed. Curtis: The file must be opened in the execution portion of the code since opening a file is an action. You have it in the declaration portion of the code. Put … | |
Re: [quote=~s.o.s~;256829]As far as part c is concerned i will give you small snippet and you can do the rest of the parts yourself. [code] #include <iostream> using namespace std ; int main (void) { int g [5], counter; for (counter = 0; counter < 5; ++counter) g[counter] = 8 ; … | |
Re: [quote=~s.o.s~;257275]Hey i was just wondering which is the prominent langauge in the United States of America which is used for development. I know it sounds a bit amatuerish but i dont know how to frame this question. Just wanted to know which langauge is worth learning so that the one … ![]() | |
Re: [B]File : Make[/B] project.EXE And please don't hijack threads. You can make your own. | |
Re: [quote=sendoshin;256324]Not to bump an old thread, [/quote] Then why did you? After three years do you really think he's been waiting for an answer? | |
Re: [url]http://cache.gizmodo.com/gadgets/images/monitor_arch.jpg[/url] | |
Re: [quote=samoguz;255553]My bad. Let me know if you can read it now.[/quote] OK, now indent your code so it can be read. After every { indent 3-4 spaces, before every } unindent. Can't tell which open brace goes with which close brace with unformatted code. | |
Re: Well, contrary to what you guys have heard, C/C++ is probably the most used language in the industry today. C# is a nitch language, Java is limited, too. ![]() | |
Re: Since [INLINECODE]mkdir()[/INLINECODE] is not a standard C/C++ function, it's not surprising it doesn't work. The standard language is designed to be ignorant of the 'outside world' (directories, screen, keyboard) so anything that uses them outside the rudimentary I/O is compiler dependant. You'll have to look through your compiler documentation to … | |
Re: Please don't be so cute with your questions. Ask it directly so we don't have to figure out what you want to know. The code is supposed to show us what you've tried, not [B]be[/B] the question. [quote=Fabii23;255824]#include <stdio.h> #include <string.h> char* string(char *str); int main() { printf("%s\n ",string(" in … | |
Re: I haven't done this since I left DOS, but I believe you have to load the driver in the System information from the Control Panel. I don't believe [I]config.sys[/I] is read in today's systems. | |
Re: Try rebuilding the other apps. If they don't work it sounds like your [I]libNcdd.so[/I] got corrupted and you need to replace it. | |
Re: I used [URL="http://www.codelifter.com/main/javascript/dropdown.shtml"]this[/URL] to add to one of my pages -- very simple. I added [inlinecode]document.theForm.theMenu.selectedIndex = 0; [/inlinecode] after the [I]window.open[/I] command to reset the selection. | |
Re: Do you want this program to work on Macs and Linux? If so, stay away from anything .NET or Windows specific. | |
Re: What was wrong with your first technique? It looked fine to me. ![]() | |
Re: What have you tried? The code posted doesn't have any file read at all. | |
Re: [quote=roseangel;250967]Hi, Sorry to ask this question, may be some kind of stupid but I just learning web design for my website only.[/quote] Sorry to have to answer this question :D Gee I'm funny -- NOT! [quote=roseangel;250967]Can anyone recommend any link or web address where I can learn how to build … | |
Re: [quote=linux;251968]I was wondering what an appropriate programming language would be for creating a simple yet expandable (GUI) operating system. Is it possible in: Python? Java? Perl? QBASIC? Ruby? Thanks![/quote] No. C, C++, Assembler, maybe ForTran or Pascal, but doubtful. Dec-10's Tops-10 I believe was written in Bliss. | |
Re: Yep. That's the first start. Be sure to use code tags... except for the [I]#include " stdafx. h"[/I] part. For the rest, you have to decide what your 'block letters' should look like, how many characters high and wide. Then use a series of [I]cout[/I] statements to output a line … | |
Re: [quote=Diode;253847]Well I coded for the backspace. Here is the code if anybody is interested... [code] if (str[num] == '\b') { str[num] = '\0'; printf(" \b"); str[num-1] = '\0'; num = num - 1; } [/code] I put it in a Do-While loop[/quote] A slightly better way may be: [code] if … | |
Re: [quote=~s.o.s~;253606] Its normally a rule of the thumb to close the file pointer as soon as you are finished with it to avoid the undefined behaviour of the file stream which you have opened. ---- It is not called not writing into the files, as mentioned by me earlier, it … | |
Re: You can't in Standard C. Some compilers have special functions that are not portable that can accomplisht what you want, but it's generally different for each compiler. So, if you want to enter the realm of non-standardization, we need more info. | |
Re: [quote=hariza;251496]Now I wonder if someone can give an idea on how would be the best way to assemble a function to do this task. Maybe which C function would be the most appropiate to handle the strings and do the word extraction without touching the tags. [/quote] So you want … | |
Re: I don't think I understand the problem. [quote=wheelz;252938]I am a newbie to C++ and I'm not sure of anything at this point in time however,I got a problem with the starting phase of this program that well prompt the user to input a single character and output a inter4national Civil … | |
Re: It would really help readability if you'd indent more. 1 space is hard to follow -- it's too much like none. Generally the recommendation is 3-4 spaces. Not a hard and fast rule, but a general rule. Readability is the key. | |
Re: Need details... | |
Re: Multiplication generally works. Even for AU dollars. | |
Re: [code] While (b not 0) { test odd or even { save the result (0 or 1) in an array } shift b right 1 bit (or divide by 2) } output the array from last value to the first. [/code] If you use the division version, [B]b[/B] should be … |
The End.