1,494 Posted Topics

Member Avatar for habib_parisa

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.

Member Avatar for jephthah
0
6K
Member Avatar for ankur_
Member Avatar for noobuser

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 …

Member Avatar for noobuser
0
175
Member Avatar for lionaneesh

[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.

Member Avatar for lionaneesh
-1
400
Member Avatar for Eternal49

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 …

Member Avatar for Eternal49
0
124
Member Avatar for aiosarem

Here's a link to XDR - library routines for external data representation [url]http://linux.about.com/library/cmd/blcmdl3_xdr.htm[/url]

Member Avatar for Salem
1
6K
Member Avatar for endritius

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.

Member Avatar for endritius
0
236
Member Avatar for tquiva
Member Avatar for Xufyan

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]

Member Avatar for sourabhtripathi
0
99
Member Avatar for bala1486
Member Avatar for bala1486
0
376
Member Avatar for koupas

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]

Member Avatar for abhimanipal
0
7K
Member Avatar for asm2hex

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]

Member Avatar for gerard4143
0
83
Member Avatar for chunalt787

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]

Member Avatar for chunalt787
0
132
Member Avatar for gerard4143

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 …

Member Avatar for gerard4143
1
180
Member Avatar for rai32

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.

Member Avatar for rai32
0
291
Member Avatar for larvee

[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.

Member Avatar for thines01
-1
3K
Member Avatar for hqt

[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 …

Member Avatar for thines01
0
83
Member Avatar for campbellpatrick
Member Avatar for hikarip

[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?

Member Avatar for jamaal
0
163
Member Avatar for Griff0527

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]

Member Avatar for Griff0527
0
227
Member Avatar for jsphb9000

Look very closely [CODE] else if(xcoord<0 && ycoord>0); [/CODE] Notice the semi-colon.

Member Avatar for gerard4143
0
268
Member Avatar for scarypajamas

[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] …

Member Avatar for scarypajamas
0
107
Member Avatar for ayushky

Probably the simplest and most secure is to keep all your source code on a removable media.

Member Avatar for Ancient Dragon
0
283
Member Avatar for bittu1028

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]

Member Avatar for Ancient Dragon
-1
92
Member Avatar for masza

If you new to Linux shell programming try here: [url]http://tille.garrels.be/training/bash/[/url]

Member Avatar for gerard4143
0
53
Member Avatar for tskellyfla

Are you talking about the angle between the minute hand and the hour hand, measured at intervals.

Member Avatar for jonsca
0
193
Member Avatar for Griff0527

[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]

Member Avatar for Griff0527
0
9K
Member Avatar for lionaneesh

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.

Member Avatar for jephthah
0
147
Member Avatar for Xufyan

Sounds like your having problems understanding functions...Check out this link [url]http://www.mycplus.com/tutorials/c-programming-tutorials/functions/[/url]

Member Avatar for Sodabread
0
103
Member Avatar for ilkeamasya

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.

Member Avatar for ilkeamasya
0
249
Member Avatar for ilkeamasya

[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 …

Member Avatar for ilkeamasya
0
250
Member Avatar for riahc3

[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 …

Member Avatar for jephthah
0
203
Member Avatar for veeresh.k

[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.

Member Avatar for Salem
0
121
Member Avatar for Signal_Hill

This doesn't sounds right - if statement - are you sure its not the for statement?

Member Avatar for Adak
0
93
Member Avatar for schwarznavy

[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 …

Member Avatar for schwarznavy
0
150
Member Avatar for lotrgandalf

You could try some shared memory...I know you can share memory through a Dll in Windows.

Member Avatar for gerard4143
0
102
Member Avatar for tedsu

You really should mix cout and printf especially in the same line...When you have this <

Member Avatar for Banfa
0
242
Member Avatar for Griff0527

If your using fscanf then it should read like [CODE] fscanf(stdin, "format string", ....); [/CODE]

Member Avatar for Griff0527
0
141
Member Avatar for andrew732

You could try this site: [url]http://www.freebyte.com/programming/assembler/[/url] You might get lucky

Member Avatar for andrew732
0
437
Member Avatar for 123a

[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 …

Member Avatar for ben1
0
188
Member Avatar for khess

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..

Member Avatar for jwenting
1
1K
Member Avatar for DCvonB

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 …

Member Avatar for Aia
0
152
Member Avatar for Nicholas_Roge

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.

Member Avatar for NotNull
0
158
Member Avatar for mmnewbee

[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?

Member Avatar for mmnewbee
0
73
Member Avatar for jamesl22

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?

Member Avatar for gerard4143
0
437
Member Avatar for intja

[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?

Member Avatar for gerard4143
0
52
Member Avatar for Vytautas
Member Avatar for JuhaW
0
108
Member Avatar for jgehlot09

Not really sure what the question is...but you functions takes a character not a string.

Member Avatar for Adak
0
98
Member Avatar for vizionary2012

Yep this is the C section. Thought I was lost for a second with all those cout's and iostreams.

Member Avatar for gerard4143
0
97
Member Avatar for tquiva

Are you really sure you want your while to read like below? Maybe you mean while (true) or while(1) [CODE] while ('\n') [/CODE]

Member Avatar for tquiva
0
145

The End.