1,494 Posted Topics
Re: 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 … | |
Re: 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] | |
Re: 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? | |
Re: 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] | |
Re: The unnamed fields may just be padding so that the structure's data is laid out correctly...Gerard4143 | |
Re: 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 | |
Re: If you don't want an endless loop why did you write one into your program? | |
Re: Linux uses an array of function pointers for its system calls....Gerard | |
Re: [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 … | |
Re: [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 … | |
Re: try string *array[arraysize]; then to initialize array[0] = pointer to string etc.... to derefence *array[0]; | |
Re: [QUOTE=kiwihaha;552792]. but 167 cannot.. why? [/QUOTE] Not sure what you mean "but 167 cannot...why?" Cannot show A? | |
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 | |
Re: First problem you have grandtotal define as a function and variable More to follow | |
Re: 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) | |
Re: [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 | |
Re: Why are treating num_val like an array? | |
Re: 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 | |
Re: [QUOTE=Spencicle;543039] if ((first=paper) && (second=rock)) [/QUOTE] should be if ((first==paper) && (second==rock)) | |
Re: [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 … | |
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 … | |
Re: [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 | |
Re: 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 | |
Re: Check this web site out [url]http://www.databasejournal.com/features/mysql/article.php/2248101[/url] | |
Re: I seen something like this in linux socket programming. Try using a socklen_t pointer. The worst that can happen it won't work. | |
Re: [CODE] Account operator+(Account &right) should be Account Account::operator+(const Account &right) [/CODE] | |
Re: [QUOTE=swetha bandaru;536131]how to write program with void as data type[/QUOTE] [CODE] void *myvoid ; [/CODE] | |
Re: 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()) … | |
Re: Not really sure what you mean...Could you give us an example? | |
Re: [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 | |
Re: 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. | |
Re: [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 … | |
Re: you should use gcc -o filename filename.c this will produce a exe thats called filename instead of a.out | |
Re: Collect Collect::operator+(const Collect& c) should this be const since you are changing the object; | |
Re: 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 | |
Re: try the modulus operator % ie int x = (71011 % 70000); and x = 1011 | |
Re: 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 | |
Re: 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 | |
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 | |
Re: [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 … | |
Re: 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 … | |
The End.