5,676 Posted Topics
Re: Read each line If it contains "[I]Event:Access, Door:entry, Card No.[/I]", write it to the file If not, don't If not at end-of-file, go back to read the next line | |
Re: [quote=Gigs_;251639]What are something.X files and how to edit them? Thanks![/quote] Don't know. And if you don't know, why would you want to edit them? | |
Re: [quote=bobeagle;250946]But it still doesn't work for me. I'm just a freshmen. I set up a blank workplace, then win32 application project, then a c++ cource file. Then type as below: #include <iostream> void main() { std::cout <<"welcome" <<std::endl; } No matter I use "main" or "WinMain" in the second line, … | |
Re: That depends. Since we don't know what websites you're talking about, we can't tell. It could be a couple things. One way to find out is view the source of the page you're interested in. Sometimes there's information there on what they did. | |
Re: What [B]S.O.S. [/B]said. And indent more. 3-4 spaces, not 1, is standard. | |
Re: Wow! A first time poster that used code tags!!!! Thank you ! [inlinecode]while (iResponse = 0) {[/inlinecode] sets [I]iReponse[/I] to 0, which by definition is FALSE and the loop does not execute. == maybe? [inlinecode]getch()[/inlinecode] is not standard and should be avoided. Use [inlinecode]getchar()[/inlinecode] instead. And the bottom of your … | |
Re: [quote=~s.o.s~;250798]Why not try to make the variable persistent throughout the program by declaring it as global static variable ? [/quote] [quote=Anonymusius;250740]You can best (I think) make an global variable or an automatic variable in main called counter and then add it if the button is pressed. [/quote] No, you shouldn't … | |
Re: Most games are written using the C family. You just need the graphics packages. | |
Re: [quote=Lutzee;250112]Hey this problem is too simple to implemented in an objecft oriented way. Programs this small do not need to have good programming practices. Especially if teyt are just for fun. For somthing this small it only matters if it works IMO. [/quote] Well said, if all you want to … | |
Re: [quote=Ancient Dragon;249706]probably because [URL="http://www.cs.colorado.edu/%7Emain/cs1300/doc/bgi/bgi.html"]BGI[/URL] requires a 32-bit compiler, which TurboC is not. Upgrade to one of the free compilers mentioned in that link.[/quote] Just the opposite. I was using BGI back with Turbo C++ 1. Download from Borland: [URL="http://bdn.borland.com/article/21751"]Turbo C++ version 1.01[/URL] [URL="http://bdn.borland.com/article/20841"]Turbo C++ version 2.01[/URL] Other old Borland stuff … | |
Re: Look under your menus for "[I]Package and Deployment Wizard[/I]". This will create an installation package that will install you rprogram on the destination computer. | |
Re: [quote=bh_hensem;249429]the problem is how could i store the current record in the variable ? Can you give some example ? I have tried it before but the previous input have been overwrited...[/quote] Did you read in the current record? Is it still in the variable space? If so, move it … | |
Re: You've mostly got it. Each C 'string' ends in a character value of 0. That's what your "out of bounds" is really checking, really it's "end of string. Commented (and formatted properly) [code]int find_ substr( char *s1, char *s2) { register int t; char *p, *p2; for( t= 0; s1[t]; … | |
Re: Instead, figure out how to compile it without the need for the Framework. Then it can run on any Windows computer, with or without .NET | |
Re: VB is only for PC apps, therefore C. But stick with Standard C/C++ and avoid compiler-specific functions that cannot be used with other compilers. If you want a VB-like language that is cross-platform, look into Real Basic ([url]http://realbasic.com/[/url]) | |
Re: [quote=mostafadotnet;247868]Hi VinC,[I][quote]system("pause");[/quote][/I]Use instead.[/quote] No, don't. Learn your tools. Using [inlinecode]scanf()[/inlinecode] to read characters is even worse than using [inlinecode]gets()[/inlinecode] because not only does it allow you to blow your buffer boundaries but as you can see it also leaves your input stream dirty. The \n is left in the stream … | |
Re: [quote=grunge man;246061]Ok im learning how to do exponents in c++ and I get most of this, but I dont get what double means. I do however know what float is. [/quote] It simply means that the storage space (number of bytes) in a [I]double[/I] is twice the storage space of … | |
Re: I think some major clarificarion is needed. [quote=insamd;245897]I was wondering if anyone can help me in terms of using atoi to get my my results to add the 1's of my binary output and then join them together... eg. 110101 and 100101 is 4 and 3 = 43. [/quote] Do … | |
Re: [quote=aeinstein;245209]In this [URL="http://www.daniweb.com/techtalkforums/thread46884.html"]thread[/URL] WolfPack provide me a link to the [URL="http://www.digitalmars.com/ctg/sc.html"]online reference manual[/URL] for the [URL="http://www.digitalmars.com/ctg/sc.html"]free Digital Mars Compiler[/URL] that I'm using - which I've found easy to use.[/quote] I have never actually used the Digital Mars compiler, but I have never heard anything good about it. I think you'd … | |
Re: [quote=scoobie;246760]i am using a program that gets run through a windows command prompt and outputs the result to the command line screen by default. i was trying to get it to output the results to a .csv file injstead but i have no idea how to do this. [/quote] You … | |
Re: [quote=degamer106;245418][code]#include <stdio.h> struct FUN { char x; char *y; int z[20]; }; int main(void) { struct FUN fn1; struct FUN fn2; struct FUN fn3[10]; struct FUN fn4[50]; return 0; }[/code] is an assignment like fn4[23] = fn3[5] invalid?[/quote] What happened when you tried it? ;) Set up a function to … | |
Re: It might be easier to accumulate the pay with [code] set totalpay to hours * straighttime // this will include ALL hours worked subtract 8 from hours to get all overtime // time+half and double add to totalpay hours * time-and-a-half // IOW 1/2 of straighttime subtract 2 from hours … | |
Re: [quote=WolfPack;246214]Use [URL="http://www.cppreference.com/cppstring/substr.html"]std::string::substr()[/URL]...[/quote] to break the string into 4 strings of 4 characters. Store them in a string array (or 4 variables if you don't know arrays). Then work with each of the 4 strings. | |
Re: [quote=hay_man;245985]Hope you can help. The following is essentially a small problem of an overall project, i have been trying to work out how to divide an inputted string, into say blocks of 4 characters and then output these separate blocks on the screen. e.g. 1234567891234567 ----> 1234 5678 9123 4567and … | |
Re: I haven't read any of your posts to see what the problem is but it seems to me that if you are 1) Posting your code properly formatted 2) Using code tags 3) Explaining what is going wrong in understandable detail 4) Explaining what the code should do in understandable … | |
Re: Since [i]word[/i] is defined as 5 characters, and you enter "hello", the \0 at the end overwrites memory outside your string. Try increasing the size of [i]word[/i] for starters. | |
Re: [quote=jubleebow;245338]Hey guys, in matlab when u do a loop(something like this): [COLOR=red]for i=1:3[/COLOR] [COLOR=red]a= 2*i[/COLOR] [COLOR=red]end[/COLOR] You get a=2 a=6 a=9 any idea how do i assign the 3 answers(a) names so that i can calculate the product of all 3 answers?[/quote] Maybe: [code] [COLOR=Black]a = 0 [/COLOR][COLOR=Black]for i=1:3 [/COLOR] … | |
Re: When a function is finished, the final statement in the funct can be something like [inlinecode]return x;[/inlinecode] [B]x[/B] is the value returned into the variable. Example: [code] val = add(a, b); // add A and B ... int add (int x, int y) // define the add function { int … | |
Re: [quote=Micko;245275]Please add system("pause"); at the end. So it should loook like this: [code] ... exit (0); } system("Pause"); } [/code][/quote] No, don't. There is no need to call the operating system when the languave itself can pause the program by simply doing a [inlinecode]cin[/inlinecode] statement. The assumption here is the … | |
Re: [quote=the.future.zone;244993]Hello everyone. What languages are being used for instant messaging? [/quote] I use English, personally :D | |
Re: [url]http://www.borland.com/downloads/download_cbuilder.html[/url] for Borland 5.5 [url]http://www.bloodshed.net[/url] for Bloodshed DevC | |
Re: [quote=Deacon J]I didn't resurrect it...I just answered t. Don't shoot the messenger.[/quote] What makes you think [B]DMR[/B] was talking specifically to you? "Hello People" was the post salutation. The others [I]could[/I] be people, too. :) | |
Re: [quote=ammu117][COLOR=magenta]For professional development which is the best compiler? DevC++ or Turbo c++? [/COLOR][/quote] Neither, really, if you are developing professional on the job code. But if you are learning to code, [URL="http://www.bloodshed.net"]Bloodshed DevC[/URL] or [URL="http://www.borland.com/downloads/download_cbuilder.html"]Borland 5.5[/URL] command line is good for the beginner. Both can create professionall programs, they just … | |
Re: How many freakin' forums are you spamming with the same lame post?!?! Once is enough, you don't need po make 10 posts all over the place! | |
Re: Have a variable that holds the item number. Every time the ADD ITEM button is pressed, increment the item number and load the number into the text box. Make the text box 'Enable=FALSE' and it can't be edited. | |
Re: And... Are we supposed to read your entire program, figure out what's missing, and add it for you? Shouldn't you maybe [I]tell us[/I] what you're completely lost about? What doesn't work, and where the specific area is in the code you posted? | |
Re: Where is the loop that allows [inlinecode]cin>>final[count++];[/inlinecode] to accept more than one value? Because of the [B];[/B] on the line [code]while(count<10 && (reply)=='y');[/code]you have here an endless loop. [I]count [/I]and [I]reply [/I]are never allowed to change. It would also help if you start indenting you code properly so you can … | |
Re: [quote=VBWayne]I've created the following series of If statements that are totally disfunctional. I'm thinking it has to do with my lack of understanding between a function and a statement. (I'm an old mainframe programmer and sometimes have difficulties crossing over) Even though when I do a watch on the fields, … | |
Re: Look into string methods, like [i].find()[/i], [i].delete()[/i], etc. | |
Re: My preferred solution: [code] #include<iostream> using namespace std; int ReadInputFlava (); int ReadInputCart (); int main() { int flava,cart,delivery; flava = 0; cart = 0; cout<<" Mulaudzi Ice-Cream Limited\n" <<" --------------------------\n"; flava = ReadInputFlava(); cart = ReadInputCart(); cout<<"Ur flava is : "<<flava<<endl; cout<<"Ur # of cartoons is : "<<cart<<endl; return … | |
Re: [quote=degamer106]Hi. I can't a small part of this program to work correctly; the square root function either returns a bunch of funny symbols OR it returns 0.00[/quote] Split the statement into two. Print the value that goes into the sqrt() function to see it's value, then call the function. If … | |
Re: Assign more memory to the video driver? | |
Re: [code] If NOT [B]isNumberic[/B](Textbox1.value) then Msgbox("Sorry you must only put numbers") else end if [/code] | |
Re: If these are actual formulas: [quote=p_eqlz_np] Groups of Groups GG1 - (G1 && G2) || G3 GG2 - (G2 || G3) && (G1 && G4) GG3 - (G1 && (G2 || G3)) || G5 [/quote] then GG1 = G3 GG2 = 0 GG3 = G5 [quote=p_eqlz_np]Now I want to be … | |
Re: The first problem I see is you defined a pointer [I]bin[/I] but you never created space for it. A point simply points to space, yours points nowhere so your binary characters are going somewhere you really don't want them to. Second problem is [inlinecode]strrev()[/inlinecode] is not a standard function. You … | |
Re: [quote=Ancient Dragon]if you don't know where to start, here's a hint[/quote] You forgot the return: [code] int main() { // put your code here return 0; } [/code] | |
Re: Create the filename as a string value and use the string instead to open the file. | |
Re: And, [inlinecode]cout[/inlinecode] is the C++ output command, not [inlinecode]printf()[/inlinecode], so you don't need [I]stdio.h[/I] any longer. | |
Re: I would put this under "undefined behavior" and assume defining [B]a[/B] to be [B]b[/B] then [B]b[/B] to be [B]a[/B] to be a bad practice. Therefore I would abandon the concept of understanding what the compiler would do and move on to a different problem -- one that makes sense... Just … | |
Re: [quote=WolfPack]But use DevCPP at home. Maybe code that works in DevCPP will work in TurboC, although not the otherway around (not sure about that but stick with code that works in DevCPP as much as possible). [/quote] As long as standard C is used, Turbo and Dev are compatable. There … |
The End.