5,676 Posted Topics
Re: My first reaction is why bother with [I]strtok()[/I]? This is a simple program of characters, not tokens. Next, C has a function called [I]tolower()[/I] and [I]toupper()[/I] that will return the character passed in as an upper or lower case value. Good for comparing case insensitive values. It also doesn't affect … | |
Re: IMO you'd be better off writing something like [B]<*end*>[/B] between messages, rather than Ctrl-D in the file. Why would you want someone to enter Ctrl-D anyway? | |
Re: [QUOTE=CppBuilder2006;1093535]when I deal with clipboard, I [U]have to[/U] use GlobalAlloc.[/quote] That makes sense. [ICODE]new[/ICODE] allocates within the realm of the program. Once the program exits, the memory is released. The clipboard then cleared (or broken). [ICODE]GlobalAlloc[/ICODE], I assume, leaves the allocated memory until the system clears it. [QUOTE=CppBuilder2006;1093535]is it recommended … | |
Re: [QUOTE=peterpanic;1093322]I am trying to take an integer argument (1-65536) and turn it into two hex characters. [/quote] First problem -- 65536 cannot fit in 2 hex characters. 0-255 can, but 65535 takes 4. [QUOTE=peterpanic;1093322]If argument -t is -t20 then I need 0x01 0x04 in a character array for sending through … | |
Re: [url=http://www.daniweb.com/forums/thread246984.html]Yes[/url] | |
Re: [QUOTE=cthoes;1092215]i couldnt understand how fseek(fp,-size,SEEK_CUR) helps to allocate the modified data at the location where name are found to be same. it would be great help how fseek points to the location where data is going to modified. [/quote] [iCODE]fseek()[/iCODE] doesn't allocate anything. It places the file pointer at the … | |
Re: [I]size_t[/I] is a data [B]type[/B], not a data size. [I]int[/I] is a data type. [I]char[/I] is a data type. So is [I]size_t[/I]. What goes into it is the result of executing the [iCODE]sizeof()[/iCODE] 'function' -- it returns a data type of [I]size_t[/I]. | |
Re: [QUOTE=Bench;1091894]... the underlying representation of std::string is not necessarily "null terminated"...[/QUOTE] Actually, a [ICODE]string[/ICODE] is [I]not[/I] "null terminated". Period. | |
![]() | Re: If you look inside limits.h you will see the maximum values allowed -- and the name of the variable representing the number |
Re: Since no answer in 3 years to original question, probably no answer today... Check with business people in your country. | |
Re: [url=http://www.gidnetwork.com/b-38.html]This might help[/url] in making your code readable. And [url=http://www.gidnetwork.com/b-57.html]here's what [B]Salem[/B] cryptically meant about fflush(stdin)[/url]. | |
Re: You are attempting to round based on the .5, not the .57. Each answer should be 11. Did you try desk-checking the code? Assume input = 10.57. You write down the result for each step and keep track of all the variables: [ICODE]b= b*10;[/ICODE] -- what's the value of b? … | |
Re: [QUOTE=iamthwee;1090066]Just make everything public then you don't need to! [/QUOTE] Please reread [B]Narue[/B]'s response -- [I]carefully[/I] -- and you will see why this is a bad suggestion. | |
![]() | Re: Use an [iCODE]if[/iCODE] statement and an [url=http://www.asciitable.com/]ASCII Chart[/url] to test a character entered. |
Re: For first participation, you obviously ignored the request to read the forum rules, and completely ignored all the sticky posts at the top of the forum. We can't help you with the information you gave. | |
Re: [QUOTE=rajif desmara;1090414]I search modul for to studying c++ code ??? plase...help me...[/QUOTE] You should read the Forum Rules to learn how to post a useful question. "Plase"...do it... | |
Re: Only thing I'd add is extend the IF around the guts of the program: [code=c] #include <stdio.h> #include <stdlib.h> int main (void) { size_t len = 0 ; const char a[] = "c:/a/a.exe" ; const char b[] = "d:/b/b.exe" ; char buffer[BUFSIZ] = { '\0' } ; FILE* in = … | |
Re: Every time you type a character in at [ICODE]scanf("%c",);[/ICODE], do you hit an ENTER? Where does that second character go? It gets read with the next [ICODE]scanf()[/ICODE]. See [url=http://www.gidnetwork.com/b-59.html]this series[/url] about why you should not use [ICODE]scanf()[/ICODE] for character & string input. Use [ICODE]fgets()[/ICODE] instead. And in your case, you … | |
Re: Never use [ICODE]scanf()[/ICODE] to read a string ([url=http://www.gidnetwork.com/b-62.html]here's why[/url]). In your code, if you enter more than 5 characters you are overwriting memory you shouldn't touch. | |
Re: Not normally, although you can pipe stderr to a file by using [B]2[/B] in front of the pipe character: [iCODE]prog 2>err.file[/iCODE] | |
Re: [url=http://www.gidnetwork.com/b-38.html]This information[/url] will help us help you if you follow the suggestions therein. | |
Re: Answer given on another site... | |
Re: I believe the program is called [B]lint[/B]. | |
Re: [QUOTE=laelzio.mosca;1084899]I have this tic tac toe code, it`s almost working, can anybody take a look, I think the only thing wrong is in the else statement in main, but I`m not sure, I think I need to place the checkToWin and checkToBlock functions properly in main [/QUOTE] What make you … | |
Re: We don't do homework for people. Most of us already have graduated and don't need the grade. Read the Forum Rules and post an appropriate question and we can help. | |
Re: [QUOTE=Narue;1084850][B]>What is the significance of the following format specifiers:[/B] Relatively low, but they come in handy occasionally.[/QUOTE] :twisted: :twisted: [CODE] %10s - Output a minimum of 10 chars, leading spaces %.10s - Output up to 10 characters %-10s - Output a minimum of 10 chars, trailing spaces %.15s - see … | |
Re: You need a book on databases. Teaching that is beyond the scope of this forum. | |
Re: First, [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. Second, look up the [iCODE]kbhit()[/iCODE] and [iCODE]getch()[/iCODE] functions in your compiler documentation. | |
Re: Welcome. While registering, new members are requested to read the Forum Rules and other pertinent information (sticky posts with obvious titles like [B]Read this first[/B]) before posting. Did you miss this request during registration? And in English, after punctuation like [B], . ?[/B] and [B]![/B] there is always a space … | |
Re: Open your compiler's IDE Type the code in you've written Save the code Run it and see if it works. | |
Re: First off, rewrite the [iCODE]return[/iCODE] so it is understandable (i.e. simple). Then explain what you want. Your request makes little sense. | |
Re: [QUOTE=ahamed101;715494] Salem is right... String is uninitialised... you get junk for len... for sure... [/quote] Then why bring it up. He already had others confirm this. :icon_rolleyes: [QUOTE=ahamed101;715514]Yes, EOF is an issue... but while entering the character where does EOF comes into picture?... [/QUOTE] Anytime you pipe in a file … | |
Re: [QUOTE=gerard4143;1081933]Right away you shouldn't use: [CODE] char name[20]; scanf("%s",&name); [/CODE] It should be: [CODE] char name[20]; scanf("%s",name); [/CODE] [/QUOTE] Actually, no it shouldn't. [url=http://www.gidnetwork.com/b-62.html]See this[/url]. | |
Re: [QUOTE=BestJewSinceJC;1082174]I'm wondering where to find what values system() accepts. For example, I want to list the server's OS type. I already did man system, did not find it very useful. And google is returning a lot but nothing relevant.[/QUOTE] Type [I]HELP[/I] at the command line. | |
Re: The first time the compiler processes the header, [ICODE]_global_h_included_[/ICODE] is undefined so the header is processed. During this processing, [ICODE]_global_h_included_[/ICODE] is defined. Each subsequent time the header is processed, [ICODE]_global_h_included_[/ICODE] is already defined, so the rest of the header is skipped thanks to the [ICODE]#ifndef[/ICODE] | |
Re: [QUOTE=BestJewSinceJC;1082106]Ok, it just seems strange compared to how easy it is in Java.[/QUOTE] It just seems strange that girls have to sit down compared to how boys can just stand. Maybe it's the nature of the beast... Wondering why an orange and a cumquat aren't the same is a waste … | |
Re: [QUOTE=Salem;474269]Some embedded DSP chips have 32-bit chars (and 32-bit everything else) for example.[/QUOTE] Wow! They must be for Chinese :) | |
Re: Why use dynamic allocattion to define an 8x8 array? Just define board as [INLINECODE]int board[8][8][/INLINECODE]. Create a function to display the board and just call it. | |
Re: [QUOTE=vmanes;481321]I'm in Rapid City - opposite side of the state from Sioux Falls. The better side side of the state.[/QUOTE] The Wall Drug side of the state? I hope that's not what makes it better!! :icon_lol: | |
Re: I do. And nothing is EVER urgent here. Read the Rules, please. | |
Re: [QUOTE=phpbeginners;1072065]i will give you my code: and try to adopt it on your code [code]... void clear_kb(void) { char junk[80]; gets(junk); } [/code][/QUOTE] You should really read the thread you are posting in. You would have learned something about [ICODE]gets()[/ICODE] | |
Re: Display each grid you generate and see where the errors occur in the generations. Are you taking into account that the edged of the grid only have 5 neighbors and not 8? | |
Re: [QUOTE=John A;878497]I've said this already, and I'll say this again: I still think requiring X number of posts before a user can add a signature would work wonders to stopping this crap. But for some reason higher-ups disagree with me. *shrugs*[/QUOTE] So do I. For people like [B]Jen0608 [/B] with … | |
Re: Let's see... No CODE tags, even thought there are at least 6 places they are explained, and 3 of them on the main page alone. No explanation about why code was posted I guess all there is to say is: Congrats for writing some code! What's next? | |
Re: And in C [iCODE]for(unsigned i = 0; i < cantidad_frases; i++)[/iCODE] is illegal. [iCODE]i[/iCODE] must be defined before it is used, not in the [iCODE]for[/iCODE] statement. | |
Re: [url=http://lmgtfy.com/?q=C+input+output]Try this...[/url] | |
Re: Also you are not writing C++ code so all your variable definitions need to be at the top of your functions, [I]before[/I] any executable statements. And for us to follow your code, [url=http://www.gidnetwork.com/b-38.html]use proper formatting[/url] | |
Re: [QUOTE=dkalita;1028174]If you are using turbo C then use getch() not getchar(). Its in the header file conio.h.[/QUOTE] Don't listen to [B]dkalite[/B]. [ICODE]getch()[/ICODE] is not standard, [ICODE]getchar()[/ICODE] is. As for your problem, my crystal ball tells me your problem is on line 75 of your code... :icon_confused: |
The End.