1,494 Posted Topics
Have you read this? [url]http://arstechnica.com/open-source/news/2010/10/shuttleworth-unity-shell-will-be-default-desktop-in-ubuntu-1104.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss[/url] | |
Re: Your going about this the wrong way. Try using fgets() instead of fgetc(). [code] #include <stdio.h> #include <stdlib.h> #define STR_SIZE 10 int main(void) { FILE *fp; char ch[STR_SIZE]; int aInt; int bInt; fp = fopen("erogol.k","r"); fgets(ch, STR_SIZE, fp); aInt = atoi(ch); fgets(ch, STR_SIZE, fp); bInt = atoi(ch); printf("%d \n",bInt+aInt); return … | |
Re: [QUOTE=lochnessmonster;1471752]nice examples....but i fail to understand your paragraph :/ maybe u can dumb it down for me lol[/QUOTE] Templates don't support implicit conversions so they'll create a new functions/objects for each type, hence code bloat. | |
Re: The reasons will come with increased usage and eduction. | |
Re: If think you should upgrade your compiler, its passing back mangled names in its error message. This, on line 81 [code] bool search(int roll,Node **current,Node **previous) [/code] Should be [code] bool list::search(int roll,Node **current,Node **previous) [/code] | |
Re: You'll find this an interesting read [url]http://www.daniweb.com/forums/thread90228.html[/url] | |
Re: Yes, if you take the proper courses..Here's a site you should check out. [url]http://dinosaur.compilertools.net/[/url] | |
Re: You have five main functions? You should have only one main function. | |
Re: Could you explain what the second function does. | |
Re: I would read this sticky [url]http://www.daniweb.com/forums/thread70096.html[/url] | |
Re: Narue beat me to the punch...Here's my simple solution [code] #include <stdio.h> #include <stdlib.h> #include <time.h> #define ARR_SIZE 16 #define LOW 0 #define HIGH 15 int mya[ARR_SIZE] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int main(int argc, char**argv) { int … | |
Re: This line [code] while(oneAccount.balance = 10) [/code] Do you really want to assign 10 to oneAccount.balance? | |
Re: Now you have to check the characters of each line...checking for things like if, while, do and then check the last printable character to see if it is ';'. | |
Re: Try something like below..I would go over the code because I wrote this quickly [code] #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <string.h> #define BUFFER_SIZE 25 #define READ_END 0 #define WRITE_END 1 int main(void) { char write_msg[BUFFER_SIZE] = "Greetings"; char read_msg[BUFFER_SIZE]; pid_t pid; int fd[2]; if (pipe(fd) == -1) { … | |
Re: [ICODE] As you can see in the function useLocal the value of variable x is set to 25;at the first call, its value is still 25, then is incresead of 1, and when it's called another time,its value is 26. Ok, so far so good!! [/ICODE] Are you sure about … | |
Re: If I was to guest, I would investigate this line CFLAGS = $(NORMCFLAGS) What is NORMCFLAGS and is it compatible with g++? | |
Re: Could you post your errors. | |
Re: Try reading this sticky [url]http://www.daniweb.com/forums/thread90228.html[/url] | |
Re: Google is your friend [url]http://www.cs.cmu.edu/~srini/15-441/F01.full/www/assignments/P2/htmlsim_split/node18.html[/url] | |
Re: Never use gets, use fgets instead. From my help file BUGS Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous … | |
Re: Your code doesn't make sense. Why are you using fgets() on floats? Try setting up like this. [code] #include <stdio.h> #define ARR_SIZE 5 int main() { float nums[ARR_SIZE]; int i = 0; for ( i = 0; i < ARR_SIZE; i++ ) { printf("\nEnter value %d:", i + 1); fscanf(stdin, … | |
Re: Here's a good link on how to become a hacker...well how to become a traditional hacker [url]http://www.catb.org/~esr/faqs/hacker-howto.html[/url] | |
Re: Maybe you should consider that most computer languages use C as its interface to the outside world. Why would a language so foreign to C use C as its interface? Well maybe C is a general representation of the machine...I'll probably get nailed for this general/simple statement. | |
Re: Try reading your input a character at a time and checking that each one is a digit or a valid numeric symbol. [code] #include <stdio.h> #include <ctype.h> #include <stdlib.h> #define MULTI 10 int main(int argc, char**argv) { char ch[2]; int x = 0; ch[1] = '\0'; while ((ch[0] = fgetc(stdin)) … | |
Re: When you pass a character array to scanf, you don't have to use the address of operator because the array name is the address of the array..Also the main function should be defined returning an int and i is used uninitialized on line line 41. [code] #include <stdlib.h> #include <stdio.h> … | |
Re: Cause your program asks for the trailing ",". | |
Re: You don't include header files in the compile line...It should be g++ Agent.cpp -o Agent | |
Re: You can't us variables with case...It must be a integral constant. switch ( expression ) case constant-expression : statement [default : statement] | |
Re: Here's one, passing arguments to a program with argv. [code] int main(int argc, char**argv) {} [/code] | |
Re: Try rewriting like so [code] for(temp=hl;(temp!=NULL) || (bOver1==true); temp=temp->next) [/code] | |
Re: I think your function is flawed..passname should be returning or updating its member data not another object's member data. It would make more sense to have this. [code] class Customers{ private: char caName[kiArraySize]; //kiArraySize is 30 public: //this is what I need help for const char* passName() const; }; const … | |
Re: Could we see the definitions of the classes in your dynamic arrays? | |
Re: In this task you don't have remove the vowels just don't write them to the new file. Just be sure to read the input file one character at a time. If the character is a vowel the do nothing, if the character is not a vowel then write it to … | |
Re: I tried compiling your program and got these warnings In function ‘double lcm(double, double)’: 35: warning: no return statement in function returning non-void In function ‘bool isprime(long int)’: 47: warning: control reaches end of non-void function At global scope: 10: warning: ‘dividecounter’ defined but not used lcm should be returning … | |
Re: create your case like this [code] case '1': { //put code here } [/code] Use braces so you can define variables in your case. | |
Re: [QUOTE=DJSAN10;1458528]Are constants, defined by using the keyword const , external linkage or internal linkage? Can constants be modified using pointers? What about constants defined using by #define?[/QUOTE] Can constants be modified? It really depends on what you mean by modified. Does that imply the use of memory management functions? | |
Re: Use getline(). Here's an example of usage. [url]http://www.cplusplus.com/reference/string/getline/[/url] | |
Re: Try going at it like this... [code] #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> int main() { char line[50]; int count = 0; char c; while((c = getchar() )!= '\n') { line[count++] = c; } line[count] = '\0'; printf("you entered: %s\n",line); char *p = line; char *start = line;/*save … | |
Re: Try something like [code] for(int i=0; i<records && inFile; i++) { for(int j=0; j<month && inFile; j++) { inFile >> monthArray[i][j]; } } [/code] | |
Re: Store the data in a structure [code] struct mys { unsigned int x; unsigned int y; }; struct mys the_s[10] = {{1, 2}, {3, 4}, {5, 6}, ...}; [/code] | |
Re: Your missing a ) and have one too many ; [code] if (progressBar1->Value == 2000) { label1->Text = "Hello"; } [/code] | |
Re: Could you post the error and use the code tags? | |
Re: I cleaned your code up a little...well a lot [code] #include<pthread.h> #include<stdio.h> #include<sys/types.h> #include<semaphore.h> #include<unistd.h> pthread_t t1,t2; pthread_attr_t tattr; int counter; sem_t mutex; void* runner(void *arg) { int i = 0; printf("Thread received %i\n", *(int*)arg); for(i = 0; i < 5; i++) { sem_wait(&mutex); printf("Thread %i says %i\n",*((int *)arg),counter); counter++; … | |
Re: Well the member function 'get_gas' requires a double.. [code] void Car::get_gas(double fuel_level) [/code] | |
| |
Re: Try something like below [code] #include <stdio.h> #include <string.h> char data[] = "Hello, World!"; const char *delimiters = " "; void function (char* array []) { array[0] = strtok (data, delimiters); fprintf(stdout, "first string->%s\n", array[0]); array[1] = strtok(NULL, delimiters); fprintf(stdout, "second string->%s\n", array[1]); } int main () { char* array[2]; … | |
Re: Why are you doing it this way? Try sorting the values and then print them. |
The End.