1,494 Posted Topics

Member Avatar for kumar rohit
Member Avatar for c+++
Member Avatar for jrkeller27

1. why do you do this "After filling out this info, I am using memmove() to put all of the data into a char array and use send() to send the information. All of the sent data (except sendString) is converted to network byte ordering." just cast the structure to …

Member Avatar for gerard4143
0
829
Member Avatar for Dixtosa

Not sure what your asking? Do you mean you want to create: 1. a thread which exists in the current process 2. a new process which exists independently

Member Avatar for ov3rcl0ck
-2
265
Member Avatar for tomtetlaw

choice is defined as "" maybe you should try defining it as an array of characters. Something like [CODE] choice: db " " [/CODE]

Member Avatar for tomtetlaw
0
71
Member Avatar for vandna
Member Avatar for Gaiety

[QUOTE=Gaiety;1004560]This Question is not programming related but rather important for all compiler related programming languages especially the Language C. what is portabily? since my graduation i have been taught C is not 100 % portable language. but i dint get any satisfactory answers for,not 100 % portable? where its lagging …

Member Avatar for dkalita
0
96
Member Avatar for stuartc
Member Avatar for chrisname

[QUOTE=chrisname;1001774]I'm actually writing this code as inline ASM but I feel it is more relevant to ASM than it is to C... Basically all I want to do for now is print the alphabet. However I'm having some trouble getting used to AT&T syntax (I would rather learn it than …

Member Avatar for chrisname
0
189
Member Avatar for DARK_BYTE

That's because your writing the binary/hex value of the integer and not its ascii text representation... The best way to read and write a structure is to write the structure all at once i.e. [CODE] struct person { }; struct person Person; write(fd, (char*)&person, sizeof(struct person)); read(fd, (char*)&person), sizeof(struct person)); …

Member Avatar for gerard4143
0
4K
Member Avatar for Rabex
Member Avatar for sanushks

Looks like you mixing i386 and x86_64 code according to you error message "ld: warning: i386 architecture of input file `chglobals.o' is incompatible with i386:x86-64 output" Here's a simple makefile to create a shared object and use a shared object...Hope it helps [CODE] test: getsetx.so test.o gcc test.o -o test …

Member Avatar for sanushks
-1
128
Member Avatar for gerard4143

Hi everyone, I recently installed Slackware 13/x86_64 on one of my boxes and now I'm having troubles with Python code that uses threading and Tkinter. This problem never existed on other Linux distro's, it just appeared with Slackware. The box in question Acer Athlon x86_64 single core used to run …

Member Avatar for ov3rcl0ck
-1
531
Member Avatar for jbennet

Well Linux has a few - Code::Blocks, Gedit, Kwrite, KDevelope, Gvim and so on. Myself I'm fond of Vim/GVim

Member Avatar for jbennet
0
124
Member Avatar for ov3rcl0ck

[QUOTE=ov3rcl0ck;1001094]So when I take an argument off the stack it seems that is in the form of a string, is there a way i can convert it to a integer so i can "cmp" it with another argument which i also wish to convert to an int? I am a …

Member Avatar for ov3rcl0ck
-1
288
Member Avatar for Gaiety
Member Avatar for ulcimd1

If your going that route I would check the sizeof(argc) just to see what your dealing with, .i.e is it an unsigned char, unsigned short or whatever Just to see what size of variables are accepted

Member Avatar for Tom Gunn
0
116
Member Avatar for DARK_BYTE

This works..maybe you can figure out why [CODE] #include<stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include<unistd.h> #include<string.h> struct Student { char name[21]; char id[11]; char DOB[9]; char gender[2]; char status[2]; }; struct Student myArr[5];//An array of Struct Student int main() { int x, y, z; char dumb[1]; char newline[2] = …

Member Avatar for DARK_BYTE
0
233
Member Avatar for duggydiggy

Why do you insist on redefining functions...Try this [CODE] #include <stdio.h> void memseta(void *dest,int val,int cnt) { while(cnt--) { *((char *)dest++) = (char)val; } } int main() { char arr[]={1,2,3,4,0}; memseta(arr,103,4); printf("%s\n",arr); return 0; } [/CODE]

Member Avatar for MrNoob
0
72
Member Avatar for vanand
Member Avatar for romes87

Why don't you def your function like [CODE] def second(s): str = string.split(s) return str [/CODE] then you can print it like print str(second(string))

Member Avatar for romes87
0
4K
Member Avatar for katwalatapan

Dumb question - do the character pointers in this structure receive memory references or do you expect them to be created by the message queue in the receive funtion? [CODE] struct test { int a; char *b; char *c; }; [/CODE]

Member Avatar for gerard4143
0
1K
Member Avatar for ov3rcl0ck

[QUOTE=ov3rcl0ck;998781]I'm extremely new to assembly and was wondering if there is a speed difference between 16, 32, and 64bit registers.[/QUOTE] Not sure what you mean by faster... 64 bit register/CPU's are faster yes because they can transfer more data plus the CPU has twice as many general registers so a …

Member Avatar for wildgoose
-1
164
Member Avatar for SomewhereInKS

I would check the way your accessing your list xylist[0][1] is the way I do it Or is your way the new Python 3.1.1 way of doing things

Member Avatar for snippsat
0
232
Member Avatar for duggydiggy

When I create my own string length function I use [CODE] int mystrlen(char *s) { int i = 0; while (*s++) ++i; return i; } [/CODE] Try this function Also by gcc do you mean Linux?

Member Avatar for duggydiggy
0
189
Member Avatar for Nathan Campos
Member Avatar for vileoxidation

Whenever I've worked with linked lists they have always had a head node, internal node and a tail node. The job of the head node is to point to the first node which is the the tail node initially. The job of the tail node is to signal the end …

Member Avatar for vileoxidation
0
286
Member Avatar for AutoPython

First random by function is not random...no matter what they call the function it is predictable... Second you really should read up on this field "encryption", its big and diverse I doubt you came up with a new idea.. I really hate to busting bubbles but the truth is encryption …

Member Avatar for ov3rcl0ck
0
574
Member Avatar for tgreco

I have no idea why this is happening but you may get better results if you gave us the name and website of the Python app

Member Avatar for tgreco
0
493
Member Avatar for Ineedhelpplz
Member Avatar for edwar

Depends what you mean by remove..Do you mean replace with spaces or do you mean take the character out and shift everything over one space....

Member Avatar for gerard4143
0
105
Member Avatar for scru

Why don't you use the Python interpreter...It does a great job of parsing

Member Avatar for scru
0
196
Member Avatar for ankit894u

It says right in the attachment "use the second method in the textbook to compute the integral" From the brief description it just looks like the summing of areas under the curve where each area calculation is handled by its own thread... This is my interpretation of it but I …

Member Avatar for ankit894u
0
86
Member Avatar for pokerstar

If this is C++ code/compiler then you should be able to instruct the compiler to stop before assembling, so the output should be in the form of a assembler code file..

Member Avatar for pokerstar
-1
177
Member Avatar for soulrider

If your using old Python code with Python 3.x.x then you may have to port the programs because Python 3.x.x doesn't guarantee backwards compatibility

Member Avatar for vegaseat
0
291
Member Avatar for sysenm

Do you mean all combinations that are words or do you mean all combinations of the letters regardless if they form a correct word?

Member Avatar for sysenm
0
104
Member Avatar for dheerajsuthar

Number one your posting title is misleading "Problem with fork system call". The system call is working just the way its supposed to. I kind of see what your trying to do here, copy a file and display its progress at the same time...this to me sounds like a problem …

Member Avatar for dheerajsuthar
0
170
Member Avatar for erckle

[QUOTE=erckle;995210]Sorry guys...this is probably really trivial but i'm new to Python. How do you remove the first digit from a five digit number called x and then add this new number to the original x. I need to be able to remove any of the digits and add the new …

Member Avatar for leegeorg07
0
4K
Member Avatar for Samyx

I am using the file ex3test.c to run the following program, but the UNIX gives the errors: [38] $ gcc -o ex3test ex3test.c Do you mean when you compile ex3text.c it gives you errors

Member Avatar for Samyx
0
175
Member Avatar for geoffy0404

I really don't see the purpose of the quotes [ICODE] int assignment1[30]; " "; [/ICODE] Won't this achieve the same thing [ICODE] int assignment1[30]; [/ICODE] Plus this line [ICODE] char totalPoints = "assignment1; + assignment2; + assignment3; + assignment4; + assignment;5 + assignment6;"; [/ICODE] should be [ICODE] char totalPoints[] = …

Member Avatar for chesspest
0
119
Member Avatar for movie55

Your array maybe too big. Try decreasing the size of the array and see if the seg fault goes away...G

Member Avatar for dkalita
0
76
Member Avatar for TGeorge824
Member Avatar for dkalita
0
127
Member Avatar for russey123
Member Avatar for kvprajapati
0
78
Member Avatar for rfm

I only read this quickly and I have a hard time understanding why this is only five bytes [ICODE] char *msg = (char *) malloc (5); [/ICODE] Since copy "Hello, " to it then you strcat "Fred" to it

Member Avatar for Samyx
0
100
Member Avatar for s.praneeth
Member Avatar for nateuni

Disregarding a return value is harmless. Well with that said I should mention that the return value is lost but if its deemed insignificant then no harm done

Member Avatar for gerard4143
0
131
Member Avatar for chico2009

try [ICODE] x ==1 or x == 2 [/ICODE] your version is always true [ICODE] x ==1 or 2 [/ICODE] since 2 is not 0 so anything or'd with a true value is true

Member Avatar for chico2009
0
186
Member Avatar for s.praneeth
Member Avatar for s.praneeth
Member Avatar for gerard4143
0
246
Member Avatar for jralexander137

If your doing a straight rev of bytes why are you stripping the first bit [ICODE] x = (x & 0x7FFFFFFF ); [/ICODE]

Member Avatar for codeguru_2009
0
241

The End.