19,876 Topics
![]() | |
this is the code( not a complete code) [code=c] int master(int argc, char *argv[]) { int slaves_count = 0; m_host_t *slaves = NULL; m_task_t *todo = NULL; int number_of_tasks = 0; double task_comp_size = 0; double task_comm_size = 0; int i; xbt_assert1(sscanf(argv[1],"%d", &number_of_tasks), "Invalid argument %s\n",argv[1]); xbt_assert1(sscanf(argv[2],"%lg", &task_comp_size), "Invalid argument … | |
Alright, here's what I'm working on now. It's supposed to go through an inputted list of words, pick out actual words and create a numbered list of them, then, where it finds a number in the list, go back in the list from that number, replace it with a word, … | |
hi, nu member hir, just hav some question regarding this output: [code] 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 [/code] numbers that are alligned with 1 are 3 5 7 9 1 3 5 7 9 these are the middle numbers... does anybody know how to do … | |
I have 3 files that i have included in a project(class,implementation,program) The program will not compile. it says system can not find specified file. Should i save all these files in the project folder or ... . It's my first time using project to write a class and all that. | |
Hi all, I need ur help.. Actually I have to read the data file which containing character and digits. I need to converts some characters into digit. The data file is like: A11111 B22222 B33333 B4444 A55555B66666 B77777 So far my programming is like this: [code=c] #include <stdio.h> #include <stdlib.h> … | |
Hi I have a sequence that I want to put into a seperate function: The variables I want to take into that function and back to the main function are declared globally. declaring the function and the testing variable: [code]void sanction (); int test[10];[/code] my main function: [code] int main(int … | |
hi am new member here... can anyone give the code of this..i've tried to figure out the code to finish this but i cant......pls help me..... here is the output of my case study Enter amount of Loan: 5000 Enter Interest: .10 Enter terms(month):10 550 445 440 435 430 425 … | |
I am coding a class project where I will have a basketball league. The league will include 3 divisions and each division will have 5 teams. Each team will have a number of players and one coach. I must have 5 seperate classes. I already have two classes called person … | |
Hello, my prof gave us a problem from the ACM programming contest, we are supposed to write a program that takes a compressed file as input and generates a reproduction of the original uncompressed file as output, the compression scheme requires making a list of the words in the uncompressed … | |
Can anyboby help me i really dont get the feeling of big o notation, i just want to understand it. | |
ok need a bit of help. got a program to set up football league table and input all the scores etc etc just tryin to figure a way to add scores and that from there, also the display code seems a bit messy anyway i can put it into a … | |
I have some problem with linked list FIFO(first in first out). This is my code: [CODE] typedef int datatype; typedef struct node *nodep; struct node *first,*last,*p; struct node { datatype data; nodep *next; }; void create(); void list(); void create() { char *tl; do { p=(struct node*)calloc(5,sizeof(struct node)); p->data=random(100); p->next=NULL; … | |
Hi, How can I open a file input.txt with the form and divide its info in differents arrays __________ n word word word abcdefgijl ijklmnñov wordxvvc ___________ n is a number, that tells me the number of words that follows here n = 3; i only know the number untill … | |
Hello. I use Linux, and I have no experience in windows. I have to write a C++ program that checks if Java is installed. I have no idea how to check that (there is no directory such /usr/bin ). I need this for a Java app and I want check … | |
I was given an assignment to write a recursive function to print a diamond comprised of astrisks (less the dashes) such as: ---* --* * -* * * * * * * -* * * --* * ---* The parameter is the number of astricks in the largest row. I … | |
Using the skeleton below #include <unistd.h> // read/write #include <sys/file.h> // open/close values #include <string.h> // strlen int main( int argc, char *argv[], char *env[] ) { // C++ or C code } Write a C++ application myrm that removes (deletes) files passed as command line argument. Use only the … | |
I need to create a function the gets a source string pointer and a destination string pointer , so if the source string will contain - "aaaabbbbbbcccdd" the function will return a destination string that contains "4a6b3c2d" This is my code , but its not working and for some reason … | |
I'm learning linked list. I have a question: How can I connect 2 linked list ? Thank you!:) | |
Hi, im trying to create a function that gets two strings , the first string its the source , and the seconed is an understring . the function should return an int with the value of the position that the understring starts in the source string . so that if … | |
this is my prob. i used goto as follows [code=c] int main() { l1: int x-9; goto l1; return 0; } [/code] this works as infinite unconditional loop is'nt it? this compiles well.which means there isnt an error. so can you explain how this variable declaration works when it get … | |
I am going through some book assignments.. and I am running into some terminology that doesn't make sense to me.. [quote] Impelement this class... Class Cis Float Cisfloat a("325.12315"); a+b a * b [b]14 (exp # bits) 113 (sigment # bits)[/b] 10000........0 bias[/quote] what does the author mean by, "exp … | |
Does anyone know any Winsock books I need them so I can learn about the functions and the coding about it. So if anyone has any books that They can post about that would help me out ty | |
Hey there everyone^^ Im almost finished on my mighty code of mighty... urm, -ness :mrgreen: The finished code is actually to calcuate displacement thicknesses of various velocity profiles (read from flies as floats) using the trapezium rule. Its sooo close, ive got a few little bugs remaining tho. Firstly, the … | |
i dont know if this the appropriate forum for this question, I wrote few programs on turbo c++ ide and they work perfectly fine. but when i try to compile the same code in openSUSE 10.2 , i get errors like : clrscr not recognised, clreol not recognised, gotoxy not … | |
Is there a function that draw 2d objects like boxes and circles . I remember that in qbasic there was a few 2dobjects functions so i thought that there is a chance c will have some too. Thanks . | |
[code] #include<stdio.h> #include<conio.h> void values(int a[4]); void main() { int x[4],i; clrscr(); printf(" enter 1st number "); scanf("%d",&x[0]); printf(" enter remaining values "); for(i=1;i<4;i++) scanf("%d",x[i]); values(x[4]); [COLOR=red](cannot convert int to int* and type mismatch in[/COLOR] [COLOR=red]parameter 'a' in call to'value(int *)[/COLOR]' getch(); } void values(int a[4]) { int m,max,min,j; max=m; … | |
i need a program , that receives an input file with words and a puzzle and gives an output file, with the words and their coordenates in the puzzle. input has the number of words (3 in this case), the words to be found, and the text where the words … | |
[main() float a=0.7; while(a<0.7) { printf("true statement"); } } how this is a true statement??? though i got some explanation, i'm not satisfied can any1 giv me a exact reason??? | |
I've got an assignment which says "Write a program to find complex numbers". Could someone explain the question ...what do i need to do? do i need to check the user input for complex no. ?? im not asking for codes, just the logic. Please help :sad: thanx for reading … | |
I'm having some trouble understanding how Exceptions thrown from constructors work... Let's say I have a class like this: [code=C++] class A { public: A() { if( error ) throw MyExp; } } [/code] If I try to define a variable of type "A" within a [inlinecode]try {} catch {}[/inlinecode] … | |
Hi there^^ Its my first post on these forums, and as much as I hate it to be a shout for help ive got a problem I could really use someone with a bit of knowledge to help me out with =) My scenario being ive got to write a … | |
Hello, at the third post of this thread: [URL]http://gpwiki.org/forums/viewtopic.php?t=4164[/URL] you can see these two sentences: "if you go to properties and put in as linker dependancies SDL.lib and OpenGL.lib". "and make sure the paths to both the .lib files are in the linker input directory value" Can someone tell me … | |
I would like to make this first function work as the one were i opened it from a file. In this first one i am using arrays the second one uses strings. ignore the masking of the password in the first one i want it to do that and then … | |
[code=c] /*factirial*/ #include<stdio.h> #include<conio.h> void main() { int n,s=1,i; clrscr(); printf("enter n "); for(i=1;i<n;i++) { scanf("%d",&n); } for(i=1;i<n;i++) { s=s*i; } printf("factorial is %d",s); getch(); }[/code] | |
I am writing a program to prove if a code is a Palindrome or not and must use stacks. I have written a code below that compiles, but when I run it, it outputs the word in an a stack view, but does not follow the rest of my program … | |
Hey, for part of my project, I have to implement a Hash Table template. I had to implement several other classes too, and I finished them. But I really don't know much at all about hash tables and templates, and am not sure how to go about this at all... … | |
how do you print an array out in reverse order? lets say the program prints out the sum of a problem and that sum is 51. how do i get it to say 15, beccause thatwould be the reverse order? | |
hi i use wattcp to program network Dos programs but when i use the received function in pcpkt.c library it always give me null in spite of that there are many packets are received and i do not know why that function do not gve me any packet | |
Hello... I was given this forum address by a friend, and I am in need of some C++ help. I have just recently began learning about C++, and have been given a series of programs to do. I have completed the 4/5, and they work well. The following is the … | |
I want to type a word in, but i do not want to see the characters. Example: If i type "What" i want to see "****", but the words have to be stored in the '*' any ideas. I know they is a way to clear the stream after i … | |
I have a function called rounds that that carries out a round for a two player guessing game the score is calculated based on the time taken and the attempts used [code] void rounds(int rand, int guess) { int attempts=1; const int MAX_ATTEMPTS = 5; int score; long int timetaken; … | |
I want to implement tab completion to my program, similar to a unix shell's. Like if the user types comp and hits <tab>, completion would appear (suppose there's a file named "completion" in the current directory). Someone suggested using the readline library, but it seems too difficult to use that. … | |
I have a debian base install system and am having problems with performance via allegro. I made a pong game and when I ran it on windows it ran fine but on linux it lags soooo much. Whats the problem? | |
hi, i want to binary write the fields of class to a file.Mainly i want to serialize only the public fields not the private ones or the functions.... [code] class a { public: int a; int b; protected: void function1(); void function2(); private: int c } [/code] | |
Hi! Sorry, if something like this was published, but I still have a question. I'm not a C developer at all, so may it's not a correct place for the topic, but... I have many MP3s without any ID3 tags, but I would like to add some. All of the … | |
I am encountering some problems in turboC v2.01....whenever I compile a prog. and error says that " the compiler is unable to include the library stdio.h and math.h" Please help!! | |
I have a question: I have a file named "data.inp". This file have numbers: 6 3 5 4 5 2 5 3 1 5 8 7 9 2 5 6 3 5 8 4 6 If I want more line of numbers, I will add numbers. But I don't know … | |
The End.