1,494 Posted Topics

Member Avatar for y_alhasa

[QUOTE=y_alhasa;1162485]We are asked to write a NASM program that will read a list of 10 2-digit integers, and output them in a column. At the base of the column, give the average value of the set of integers.[/QUOTE] I'm not a NASM fluent person but do you mean two digit …

Member Avatar for MosaicFuneral
0
105
Member Avatar for lugan

This would make more sense if you posted the skeleton code along with the explanation...

Member Avatar for lugan
0
100
Member Avatar for newbiecoder

Try this instead fgets fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is read, it is stored into the buffer. A '\0' is stored after …

Member Avatar for newbiecoder
0
256
Member Avatar for mutazzaki

Please post your program and indicate the areas your having problems with...

Member Avatar for gerard4143
0
103
Member Avatar for akssps011
Member Avatar for prushik

Man has this bug BUGS sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and sleep() is a bad idea. Using longjmp(3) from a signal handler or modifying the handling of SIGALRM while sleeping will cause undefined results.

Member Avatar for prushik
0
267
Member Avatar for strmstn

Most/all C/C++ compilers have a swtich to allow you to view the assembled code gcc's switch is -S `-S' Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified.

Member Avatar for strmstn
0
204
Member Avatar for pikesh

[QUOTE=pikesh;1158783]what is lvalue required in turabo c++,Hoe i can solve this type of error?[/QUOTE] Its probably means you need to have an assignable value on the left hand side.. example: [CODE] #include <stdio.h> int main(void) { int x = 0; 5 = x; return 0; } [/CODE] generates a compile …

Member Avatar for gerard4143
0
86
Member Avatar for tinkerkyala
Member Avatar for ravikiran32

[QUOTE=ravikiran32;1158373]i have written small c language code to execute "dir" command which displays directories and files in the current directory, using system() function in c. But my code doesn't work. please help me. [CODE]# include <string.h> # include <stdio.h> # include <stdlib.h> void main() { clrscr(); system("dir"); getch(); }[/CODE][/QUOTE] You …

Member Avatar for gerard4143
0
158
Member Avatar for johndoe444

Or you could try Gawk/Awk [CODE] awk '{for (i = 2; i <= NF; ++i){printf("%s ",$i);{if (i==NF){printf("\n");}}}}' filename [/CODE]

Member Avatar for Skifter
0
266
Member Avatar for copa1x1

The thing is...If you can execute the line in a bash terminal then you can include it in a bash shell script bash.sh [CODE] #! /bin/sh ...your steps go here 1. mount /dev/sda1 /mnt/usbdisk 2. rsync -av /mnt/usbdisk/content*.mpg /mpgfiles --progress 3. Wait for the rsync to finish - perhaps show …

Member Avatar for Skifter
0
195
Member Avatar for tyliang

Tried compiling your program but.... prg1.c: In function ‘main’: prg1.c:20: warning: ISO C90 forbids mixed declarations and code prg1.c:23: error: ‘stock’ undeclared (first use in this function) prg1.c:23: error: (Each undeclared identifier is reported only once prg1.c:23: error: for each function it appears in.) This head=(struct stock*) malloc(sizeof(stock)); should be …

Member Avatar for uskok
0
265
Member Avatar for thehivetyrant

Maybe you should check out those 'warnings' the compiler generates them for a reason..You should never ignore a warning unless you have a valid reason. Also never and I mean never use gets() This will print your prompt...and compile without warnings or errors...your code had a few [B]errors[/B]. [CODE] #include …

Member Avatar for Salem
0
113
Member Avatar for phil750

Here's an example: But first - create a text file mydata and put some text in it.. [CODE] #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> int main(int argc, char**argv) { char ch[100]; int infile, outfile; infile = open("mydata", O_RDONLY, 0666); if (infile < 0) { fputs("could not open infile!\n", …

Member Avatar for phil750
0
114
Member Avatar for cyberguy007

[QUOTE] My input file contain: 1 2 3 4 5 6 [/QUOTE] Are the file values integers or ascii text?

Member Avatar for WaltP
0
101
Member Avatar for phil750

[QUOTE=phil750;1152503]Im mid way through writting my own c shell and having trouble with my redirecting, i use strtok to spilt the input into 2 parts, argv0 being command and argv1 being cmd i have this for redirecting so far [code] if(strcmp(cmd,">")==0) { strcpy(filename, command); filein = open(filename, O_RDONLY); dup2(filein,0); close(filein); …

Member Avatar for phil750
0
1K
Member Avatar for DarkC0de

[QUOTE=DarkC0de;1152534]hi when I use this with my program i have msg tell me about the warning in my program please any one explain it thanks[/QUOTE] ggdb [QUOTE] `-ggdb' Produce debugging information for use by GDB. This means to use the most expressive format available (DWARF 2, stabs, or the native …

Member Avatar for UncleLeroy
0
1K
Member Avatar for Morrac
Member Avatar for donelliewhyte

[QUOTE=donelliewhyte;1150567]IF i write to file REGISTRATION NUMBER :1001 how can read back from the file the 1001. Thank you for all your help,i have gotten other hints but they don't seem to work[/QUOTE] Well lets see what you've done with some of your hints.

Member Avatar for jephthah
0
78
Member Avatar for alcapone11

[QUOTE=alcapone11;1148854]hi, i'm beginner in assembler, i'm just start study this language... please can someone explain me, what do this two functions? cbr flags, (1<<pressed) ;Clear status flag sbr flags,(1<<pressed) ;Set status flag please if you insert example, it will be only better...:)[/QUOTE] These above instructions...which machine do they go with?

Member Avatar for alcapone11
0
94
Member Avatar for Aurorian
Member Avatar for Murtan
0
98
Member Avatar for kendaop
Member Avatar for abhimanipal
0
127
Member Avatar for aliase
Member Avatar for gerard4143

Hi, I wrote this simple bash script(yeah simple now that its done) and it uses bc - 'The arbitrary precision calculator language' and tr - 'translate or delete characters'. Now the script works, it will take input values and convert them to the proper output values. Now my question is..is …

Member Avatar for gerard4143
0
401
Member Avatar for Agello

Scanf isn't clearing the input buffer of the new line character.. i.e. When you enter an operator you enter the operator character plus you hit the return key...So two characters are placed in the input buffer, the one you want plus the newline character and scanf only picks up the …

Member Avatar for Agello
0
262
Member Avatar for ipride

Most C++ compilers offer a setting to stop compiling.. In GNU its g++ file.cpp -S [QUOTE] `-S' Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified. [/QUOTE]

Member Avatar for gerard4143
0
114
Member Avatar for johndoe444
Member Avatar for gerard4143
0
71
Member Avatar for katwalatapan
Member Avatar for bd338

Can you post an objdump of the code? I want to see how Nasm is addressing message db "Hello, world!", 0 If you can't provide an objdump of the code then try moving message db "Hello, world!", 0 to the end of your code....Initially your instruction pointer may be trying …

Member Avatar for gerard4143
0
216
Member Avatar for HBK_100
Re: File

Is this the new format for posting code? What happen the code tags?

Member Avatar for WaltP
0
118
Member Avatar for fux0r
Member Avatar for HBK_100
Member Avatar for miskeen

[QUOTE=miskeen;1142848]Hello, I've an external/global array that is used every where in my code.[CODE] // global.h file short is_valid[10];[/CODE] I initialize my array somewhere in the code and I want to check if everything works. When I try to print the values of the array, I get segmentation fault. [CODE] // …

Member Avatar for Dave Sinkula
0
59
Member Avatar for VernonDozier

Are you talking about a variable length argument list? If you are then google "C variable length argument list".

Member Avatar for VernonDozier
1
232
Member Avatar for its_yogy
Member Avatar for veronica_0501

[QUOTE=Narue;1141767][B]>Its urgent[/B] For future reference, stating that your problem is urgent will likely be counterproductive. A lot of us are perverse enough to ignore you solely because you're in a rush. [/QUOTE] Sad but true...

Member Avatar for gerard4143
0
139
Member Avatar for gplkrsna

[QUOTE=gplkrsna;1141612] I have two libraries with two different queue implementations. but with same structure name as "queuetype". [/QUOTE] Question - are the structures queuetype the same in both files(besides the name)?

Member Avatar for Narue
0
125
Member Avatar for spursfan2110

why do you define your int like this long int &max; with the "&"... Don't you mean long int max;

Member Avatar for Dave Sinkula
0
187
Member Avatar for johndoe444

[QUOTE=johndoe444;1141232]I figured my stupid silly mistake. children[i+degree] is not a pointer. What punishment do you suggest to give johndoe for such a moronic act?[/QUOTE] How about getting you to post this in the C++ section [QUOTE] Note: I used g++ to compile this. How to change things to compile without …

Member Avatar for gerard4143
0
247
Member Avatar for DHPena

Why can't you send integers with write.... [CODE] int myint = 1234; write(fd, (char*)&myint, sizeof(int)); [/CODE]

Member Avatar for DHPena
0
440
Member Avatar for bd338
Member Avatar for bd338
0
150
Member Avatar for johndoe444
Member Avatar for igodspeed
Member Avatar for gerard4143

This is a Linux brainteaser for the C comfortable and leisurely bored. I'm not looking for the answer.. Note the compile lines are commented at the bottom of the program - Ubuntu and derivatives please use the second compile line or it will not work. So what does this program …

Member Avatar for gerard4143
0
136
Member Avatar for funtoknow

Since this program has some problems, could you tell us in words what you are trying to do here.

Member Avatar for pebbles
0
393
Member Avatar for EvilNerd
Member Avatar for ShortYute

I would check out this link [url]http://en.wikipedia.org/wiki/C_preprocessor[/url] especially the section 'Conditional compilation'

Member Avatar for Salem
0
182
Member Avatar for COKEDUDE

Try googling stdio Or you could start here [url]http://en.wikipedia.org/wiki/Stdio.h[/url]

Member Avatar for WaltP
0
112
Member Avatar for newcuser

[QUOTE=newcuser;1135856]I am trying to input a text file with twenty unsorted names in it into an array and then perform a bubblesort and output to a new file. The filename for the txt file is names.txt Here is what I have so far....not much...I would appreciate some help the right …

Member Avatar for newcuser
0
2K

The End.