1,494 Posted Topics
Re: Right away, these lines should occur outside of the main function. [CODE] int *make_pointer(int); void read_array(int *array[3]); [/CODE] Also, you should call free the same number of times you call malloc. | |
Re: I know Gnome/System Monitor provides those details. | |
Re: Don't and I mean don't ever use [CODE] gets(myString); [/CODE] Read Please BUGS Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is … | |
Re: [QUOTE=Salem;1214254] The parentheses are optional when applying sizeof to a variable. p = malloc(sizeof words ); [/QUOTE] Now I didn't know that. I guess that's why I keep coming back. | |
Re: Your problem is this line right here [CODE] ipray[i] = *tok; [/CODE] Which doesn't do what you think it does. Take a look at this version which is a simplified version of your code and is correct...Now all you have to do is convert the values to integers or copy … | |
Re: Here's a link to XDR - library routines for external data representation [url]http://linux.about.com/library/cmd/blcmdl3_xdr.htm[/url] | |
Re: You define your function header like [CODE] void product (float x, int y, float *prd) [/CODE] and [CODE] void product (float, int, float) [/CODE] Which are different. | |
Re: You could help us out and post the code. | |
Re: The second loop allows us to check each element against all the other elements. Just a note: [CODE] printf("Enter Value for %d",i); [/CODE] The printf should be [CODE] printf("Enter Value for element [%d]->", i); [/CODE] | |
Re: I would try printing the value of file1, just to see what the function is returning. | |
Re: Right away you should include the string.h library for strcpy(). This line [CODE] strcpy(a.aStudent->finalMark,bathmos); [/CODE] Both variables are integers, strcpy requires char pointers. Your first scanf [CODE] scanf("%s",&onoma); [/CODE] should be [CODE] scanf("%s", onoma); [/CODE] | |
Re: Are you saying the TCP software is combining several writes into a single packet?...This is usual and up to the TCP software algorithms to decide on what is most efficient. Here's a link about forcing TCP to write data.. [url]http://www.unixguide.net/network/socketfaq/2.11.shtml[/url] | |
Re: If the cross-complier is already setup then it shouldn't really be a problem...Program as usual but run the programs on your embedded system...If your looking for tuts and docs try googling GCC embedded systems [url]http://www.linuxjournal.com/article/9904[/url] | |
I have a question, well more of a verification. In the program below, I'm packing a character array with some values. The first two are unsigned integers the next is a function pointer and the final is a string of characters...Now my question, is the casting correct for the function … | |
Re: In your client, try shutting down the write portion of the client socket after you sent the filename to the server. Also try downloading wireshark, Its great for debugging client/server programs. | |
Re: [QUOTE=larvee;1192269]How to create an assembly program that will allow the user to enter somer characters and group the characters according to the following: alphabets, numbers, and special characters. ASAP. thanks.[/QUOTE] You want your free advice/pointers - ASAP. | |
Re: [QUOTE=hqt;1185238]sorry to post this stupid question here. I'm just learning Assembler and a problem from my book is: input: a string from a user. output:character in that string. for example: input: DANI so output is: D A N I I just can received a string from user. thanks. :)[/QUOTE] Can … | |
Re: Just put a line counter in your while loop. | |
Re: [QUOTE=hikarip;1178818]in linux installation, which of these options(Advanced,Expert,Selective,Custom) allows you to select only the packages needed to suit your computing needs?[/QUOTE] Which distro offers this selection? | |
![]() | Re: Why do you have these lines if your using command line agruements to pass the values? [CODE] printf("Enter the name of the file you want to back up.>"); scanf("%s", argv[0]); printf("Enter the name of the file to back up to.>"); scanf("%s", argv[1]); [/CODE] ![]() |
Re: Look very closely [CODE] else if(xcoord<0 && ycoord>0); [/CODE] Notice the semi-colon. | |
Re: [QUOTE=scarypajamas;1200607]Maybe you could help me with the following code... [CODE=c] int main() { char foo = '?'; // foo is created on the stack. char* bar = "Hello World"; // where is bar created? // will the following result as a NOP or undefined behavior? free(bar); return 0; } [/CODE] … | |
Re: Probably the simplest and most secure is to keep all your source code on a removable media. | |
Re: Where to start...At the beginning [CODE] #include <stdio.h> #include <time.h> int main(int argc, char**argv) { return 0; } [/CODE] Plus check out the internet...like here: [url]http://www.gnu.org/s/libc/manual/html_node/Time-Functions-Example.html[/url] | |
Re: If you new to Linux shell programming try here: [url]http://tille.garrels.be/training/bash/[/url] | |
Re: Are you talking about the angle between the minute hand and the hour hand, measured at intervals. | |
![]() | Re: [CODE] int max_temp(measured_data_t id, measured_data_t temperature, , int *ID, int *max_temp); [/CODE] You have two , , with no parameter. Probably should be [CODE] int max_temp(measured_data_t id, measured_data_t temperature, int *ID, int *max_temp); [/CODE] ![]() |
Re: The best/practical socket programming book IMHO Internetworking With TCP/IP Volume III: Client-Server Programming and Applications, Linux/POSIX Socket Version (with D. Stevens), 2000. 0-13-032071-4 [url]http://www.cs.purdue.edu/homes/dec/netbooks.html[/url] Note the book is a bit pricey. | |
Re: Sounds like your having problems understanding functions...Check out this link [url]http://www.mycplus.com/tutorials/c-programming-tutorials/functions/[/url] | |
Re: Don't request everything in one scanf call. Call scanf for your sentinel value the check the result and then call scanf for the remainder. | |
Re: [QUOTE=ilkeamasya;1196596]Hello, there. I'm trying to write a program which reads student information from keyboard and does some calculations. I've just started it and I dont know much about this "Struct" topic. As far as I know, I've tried to do something and here is the result. [CODE]#include <stdio.h> #define N … | |
Re: [QUOTE=riahc3;1196567]Hey Im doing a loop with somthing similar to this: [code=C] char stn[25]; do { printf ("Insert a number:\n"); gets(stn); }while (stn!="123"); if (str=="123") { printf ("Good value!"); } [/code] Now if I input 123, it enters the if that prints "Good value!" and the program ends naturally. Now if … | |
Re: [QUOTE=veeresh.k;1196586]hi... 'm findin it difficult to access system date in a c program.. pls help me... N also to write code fo airline reservation in c...[/QUOTE] So help us out...Post what you have so far. | |
Re: This doesn't sounds right - if statement - are you sure its not the for statement? | |
![]() | Re: [QUOTE=schwarznavy;1193440]Hi. I'm trying to call a function to convert a decimal integer into a binary number (stored as an array of integers). Before I knew that I couldn't return an array, this is how I thought to implement it. Can anyone help me understand the way I'm actually supposed to … ![]() |
Re: You could try some shared memory...I know you can share memory through a Dll in Windows. | |
Re: You really should mix cout and printf especially in the same line...When you have this < | |
![]() | Re: If your using fscanf then it should read like [CODE] fscanf(stdin, "format string", ....); [/CODE] ![]() |
Re: You could try this site: [url]http://www.freebyte.com/programming/assembler/[/url] You might get lucky | |
Re: [QUOTE=123a;1166196]I need to create a shell script which will output certain lines in a file. For example ./line file1 6 11 will output lines 6 to 11 of the file. I am not good at shell script, I am a beginner. I have tried to write this script but just … | |
Re: Like most Linux users, I have tried my share of distros and always have come back to Mandriva/Gnome. It's just stable and quick.. | |
Re: I tried to simplify your code and here's what I arrived at...I got your function working now. Please note, you don't have to allocate the memory for an array that already exists. You should be able to take this and complete the rest. [CODE] #include <stdlib.h> #include <stdio.h> void get_days_in_month(int … | |
Re: I have a few questions...Is this a boot loader you wrote or one you downloaded. [QUOTE] Why would you XOR something by itself in order to zero it out rather than just moving 0000h into it? It is just more efficient? [/QUOTE] Its more efficient. | |
Re: [QUOTE=mmnewbee;1185289]Hi I,ve recently joined daniweb and was wondering if you guys might help me in writing a shellscript that automatically detects whether a flashdrive has been inserted into a usb port and recursively searches all folders deleting any .exe files it encounters. Thanx.[/QUOTE] A question...What operating system? | |
Re: I'm no expert but I seem to remember reading somewhere that you have to install all the kernel headers and source for the version of kernel your compiling...Did you? | |
Re: [QUOTE=intja;1176224]Required is a program that calculate the factorial of a non negative whole number which it gets from a user. It then displays the number and its factorial.. can any one try to test for me this algorithim? plz[/QUOTE] How did this end up in the kernel section? | |
![]() | Re: If you want to find out if this works...write and read some data to you files. |
Re: Not really sure what the question is...but you functions takes a character not a string. | |
Re: Yep this is the C section. Thought I was lost for a second with all those cout's and iostreams. | |
Re: Are you really sure you want your while to read like below? Maybe you mean while (true) or while(1) [CODE] while ('\n') [/CODE] |
The End.