1,494 Posted Topics

Member Avatar for rvaiksaar

This is a good question. It shows you are thinking past the pages in the book. The reason so many programs can exist(by exist I mean run) at the same time is - Modern operating system(multi tasking) will allow running programs to use the processor for a certain amount of …

Member Avatar for rvaiksaar
0
114
Member Avatar for mahela007

try creating your cow like: [CODE] class cow: numcows = 0 def __init__(self): cow.numcows +=1 mycow = cow() mycow2 = cow() print cow.numcows print mycow.numcows print mycow2.numcows [/CODE]

Member Avatar for djidjadji
0
175
Member Avatar for vlady

I'm not sure what your asking. Do you mean if a = 1000 and b = 10 then a/b which is 1000/10 = 100 So 10 divides 1000 equally.. Is this what you mean?

Member Avatar for vlady
0
3K
Member Avatar for chico2009

This works on my machine [ICODE] #! /usr/bin/python #Convert C to F def Tc_to_Tf(): Tc = input ("What is the Celsius Temperature ? " ) Tf = 9.0/5.0 * Tc + 32 print 'The temperature is ', Tf, ' Degrees Fahrenheit' Tc_to_Tf() [/ICODE]

Member Avatar for chico2009
0
193
Member Avatar for MrNoob

The unnamed fields may just be padding so that the structure's data is laid out correctly...Gerard4143

Member Avatar for codeguru_2009
0
144
Member Avatar for optikali

Try the appy(functionname, (args)) statement [ICODE] def printit(): print "hello, world!" ch = input("enter a func->") apply(ch, ()) [/ICODE] Now at the prompt enter the function name printit and apply will execute it

Member Avatar for sneekula
0
190
Member Avatar for sftwr21
Member Avatar for sftwr21
0
213
Member Avatar for missileh
Member Avatar for jephthah
0
143
Member Avatar for midimatt

[QUOTE=midimatt;553761]Hi Again, Well i'm bored and i've decided to do some coding just for practice and i've decided to work on a text based RPG, its only going to be basic due to my own knowledge but i think its doable. unfortunatly i've come accros a problem already and i've …

Member Avatar for WaltP
-1
376
Member Avatar for remcob

[QUOTE=remcob;553702]Hello, When I have a created a socket (sd) connection and opened a file (fd). How can I send over a file? Create a buffer (char buf[BLOCK] ????)and send over block by block or so? And if so, what is most efficient block size? Cheers![/QUOTE] Yes send it over be …

Member Avatar for remcob
0
93
Member Avatar for mrjoli021

try string *array[arraysize]; then to initialize array[0] = pointer to string etc.... to derefence *array[0];

Member Avatar for Ancient Dragon
0
91
Member Avatar for kiwihaha

[QUOTE=kiwihaha;552792]. but 167 cannot.. why? [/QUOTE] Not sure what you mean "but 167 cannot...why?" Cannot show A?

Member Avatar for Ancient Dragon
0
2K
Member Avatar for gerard4143

Hi, What I'm looking for is some good books on C or gas assembler. I would prefer the books be Linux based. So if you know any good titles could you pass them on to me...Thanks

Member Avatar for gerard4143
0
77
Member Avatar for nelledawg
Member Avatar for mitrmkar
0
161
Member Avatar for jer_stud56
Member Avatar for henpecked1

Why not make a double temp[24] array initialize the elements(to some unlikely temp say -1000) and then fill then in one at a time(for each hour)

Member Avatar for henpecked1
0
229
Member Avatar for rohoni

[CODE] #include <stdio.h> int main() { int i; char name[5]; for(i=0;i<5;i++) scanf("%c",&name[i]); for(i=0;i<5;i++) printf("%c",name[i]); return 0; } [/CODE] Compiled and ran your code...it works fine. Note main should return an int

Member Avatar for gerard4143
0
97
Member Avatar for 88omar
Member Avatar for farag
Member Avatar for EngBalsam

Do you mean if we have 16 bytes, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 then rearrage them 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8

Member Avatar for EngBalsam
0
136
Member Avatar for Spencicle

[QUOTE=Spencicle;543039] if ((first=paper) && (second=rock)) [/QUOTE] should be if ((first==paper) && (second==rock))

Member Avatar for vmanes
0
95
Member Avatar for tootypegs

[QUOTE=tootypegs;542467] I want to create a program that will copy the contents of RAM to another file. [/QUOTE] Do you mean the user processes memory or the complete memory available to the computer? Because if your looking for the complete memory of the computer its sounds like your trying to …

Member Avatar for gerard4143
0
84
Member Avatar for gerard4143

My questions is a simple/hard one, whats a stack on an intel machine? I don't a need lesson on how to use one for I already know how, its just that I really don't know very much about them. Like how come you can automatically allocate memory on them by …

Member Avatar for sanzilla
0
89
Member Avatar for Jboy05

[QUOTE=Jboy05;541990] void show_word (char); { char InName; cout << "Enter your name " << endl; cin >> InName >> endl; show_word ("hello"); show_word ( string InName); }[/QUOTE] this will produce recursion, show_word calling show_word and never end and thats just the beginning

Member Avatar for Jboy05
0
111
Member Avatar for Roebuc

If you look on the main C++ page in Daniweb you will see a posting "How do I flush the input stream". This should help

Member Avatar for Roebuc
0
586
Member Avatar for LucidNonsense

Check this web site out [url]http://www.databasejournal.com/features/mysql/article.php/2248101[/url]

Member Avatar for pritaeas
0
74
Member Avatar for winky

I seen something like this in linux socket programming. Try using a socklen_t pointer. The worst that can happen it won't work.

Member Avatar for fida hussain
0
159
Member Avatar for Jaycii

[CODE] Account operator+(Account &right) should be Account Account::operator+(const Account &right) [/CODE]

Member Avatar for Jaycii
0
144
Member Avatar for swetha bandaru

[QUOTE=swetha bandaru;536131]how to write program with void as data type[/QUOTE] [CODE] void *myvoid ; [/CODE]

Member Avatar for Narue
0
424
Member Avatar for SteveDee

If it has to be an integer then use isdigit to check that each character of the input is a digit. a simp,e way to do this is [CODE] char ch[2]; ch[1] = '\0'; int x = 0; const int MULTI = 10; std::cout<<"enter a number->"; while ((ch[0] = std::cin.get()) …

Member Avatar for WaltP
0
261
Member Avatar for monto
Member Avatar for Narue
0
99
Member Avatar for fskhan

[code=cpp]unsigned int a = (int)0x12345678; unsigned int b = 0; int i = 0; for (i = 31; i > 0; --i) { b = b + ((a>>(31 - i))<<(31)>>(31 - i)); }[/code] this will also work...member of the ugly code club

Member Avatar for jephthah
0
3K
Member Avatar for shreevidya

Just build a character array based on user input then pass it to mysql. char querystring[100]; mysql_query(conn, querystring); this is the easiest way.

Member Avatar for gerard4143
0
98
Member Avatar for newport

[CODE] #include <stdio.h> int main () { int selection; float sum, difference, product, quotient; float num1, num2; start: printf("****************************\n"); printf("What would you like to do?\n"); printf("1 = add \n2 = subtract \n3 = multiply \n4 = divide \n5 = exit\n"); printf("***************\n"); printf( "Enter your selection:"); scanf("%d", &selection); printf("Please enter the …

Member Avatar for rhish.franks
0
198
Member Avatar for dinosaurclover

you should use gcc -o filename filename.c this will produce a exe thats called filename instead of a.out

Member Avatar for plgriffith
0
143
Member Avatar for blcase

Collect Collect::operator+(const Collect& c) should this be const since you are changing the object;

Member Avatar for Agni
0
172
Member Avatar for tootypegs

try looking up xor to switch the 0's to 1's and the 1's to 0's. to rearrange the elements look up shift rigth shift left and rotate rigth and rotate left

Member Avatar for tootypegs
0
139
Member Avatar for mmcshmi11
Member Avatar for invisal
0
116
Member Avatar for elitesky

in gas (linux i386) if we had a label defining a list of bytes, say bytelabel, we would move through that list like xorl %edi, %edi movl bytelabel(, %edi, 1), %eax incl %edi

Member Avatar for gerard4143
0
93
Member Avatar for ShyamalShah

not sure if this is what you mean, but try friend std::istream& operator>>(std::istream & in, classname & rhs) the rest you can figure out

Member Avatar for gerard4143
0
89
Member Avatar for gerard4143

Is the opcode leal(load effective address) primarly used to calculated the address of a value that was pushed on the stack? If anyone knows of any good web sites on this topic could you pass it on to me. Thanks in advance....Gerard4143

Member Avatar for gerard4143
0
105
Member Avatar for mg0959

[QUOTE=mg0959;519223]I need to write a program that runs in the background without a gui window or a console window. It also needs to recognize when a key is pressed. Is there any way to do that? And if yes, then how? Any and all suggestions would be great. thanks.[/QUOTE] yeah …

Member Avatar for mg0959
0
165
Member Avatar for vnykr

Makefile: obj−m += hello−1.o all: make −C /lib/modules/$(shell uname −r)/build M=$(PWD) modules clean: make −C /lib/modules/$(shell uname −r)/build M=$(PWD) clean make −C /lib/modules/$(shell uname −r)/build M=$(PWD) modules should be tabbed in and make −C /lib/modules/$(shell uname −r)/build M=$(PWD) clean should also be tabbed in like below note: <tab> = tab …

Member Avatar for vnykr
0
225
Member Avatar for CompSec

The End.