188 Posted Topics
Re: Did you tried with [URL="http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.12.html#fgets"]fgets[/URL]? For help read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351"]this[/URL] | |
Re: Nobady will write code for U. | |
Re: [code] hndl = fopen("file.txt", "r+"); fseek(hndl, 0, SEEK_END); fprintf(hndl, "some text"); fclose(hndl); [/code] | |
Re: [inlinecode]sizeof(int*)[/inlinecode] and [inlinecode]sizeof(int**)[/inlinecode] will be the same and it is the size of pointer. [inlinecode]sizeof(int)[/inlinecode] is the size of [inlinecode]int[/inlinecode] . | |
Re: [code] int iNum; double dNum = 3.61; iNum = (int) dNum; [/code] | |
Re: If you want help you must to fix your code. [inlinecode]i[/inlinecode] is undefined and uninitialised. There are more problems with your code but first fix and beautify it. | |
Re: Use code tags, please read [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]this[/URL] | |
Re: [QUOTE=rati;268052]i need to print a wildcard * in the output . a program that takes a string as command line argument prints all the files in the directory instead of *. can u help me?[/QUOTE] Post your code, to see what have you done so far. | |
Re: Also you can do it with string. [code] len = sprintf(buff, "%d", num); for (i=0; i<len; i++) { printf("%d\n", buff[i] - '0'); } [/code] Where num is in your case 1567. | |
Re: Variable answer is float not int. Instead of [inlinecode]printf("%d",answer);[/inlinecode] use [inlinecode]printf("%f",answer); [/inlinecode] instead. Dont use nonstandard func (use them only if your teacher explicitly demanded). You need a getchar in front of choice input. Use int main and not main. | |
I think that there is a bug when watching some posts with firefox. The post orders are different for internet explorer. You can see it is the same address but there is a difference between the third post. See the pictures and you will understand. PS: Dowload the pictures to … | |
Re: Read [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]this[/URL] | |
Re: [QUOTE=Lutzee;266707]Hi there, im a c++ noobie. I have a class called node. Node has a data member id. When i try and access id in the obect named f outside of main visual studio 2003 gives me the errors: : error C2065: 'f' : undeclared identifier error C2228: left of … | |
Re: This is valid [inlinecode]if (strcmp(check->words,text)==0)[/inlinecode] and this is not [inlinecode]if (strcmp(check->words,text[30])==0)[/inlinecode] | |
Re: To many errors you have. Remove ; after [inlinecode]void gettradeIn( float& tradeIn)[/inlinecode]. Where [inlinecode]void getdownPayment(float& downPayment)[/inlinecode] func ends? | |
Re: What kind of error? You want to print the file to the screen or back to file? | |
Re: For obtaining single char you can use getchar which returns int. You can read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044652485&id=1043284385"]this[/URL] and [URL="http://www.daniweb.com/tutorials/tutorial45806.html"]this[/URL] for obtaining the whole string. | |
Re: [QUOTE=Mr.UNOwen;264117]I'm having touble trying to send arrays from funciton to function. The thing I can't do is make a global variable (one of the rules set by the teacher). I don't know what I'm doing really, so let me know if it's even doable.[/QUOTE] The answer is yes as specified … | |
Re: Check this [URL="http://www.daniweb.com/tutorials/tutorial45806.html"]link[/URL] | |
Re: [QUOTE=dhruvisinha;265140]hi, i need the program code and algorithm to find the sum of the sin and cos series, print 1/232/34543/4567654 in the form of a triangle. Please mail me the solution on **** thanks so much.[/QUOTE] I have a feeling that your e-mail address will be removed. Read the forum … | |
Re: For me there are much more errors. Are you shore that you posted the whole code? | |
Re: What part U dont understand? The void pointer? Well void pointer can be used if you are not shore which type will be passed to func compare. BTW const void must be separated. | |
Re: [QUOTE=jack19;263839]hi jack here,i want to which are the best websites who could offer me clear and total info and tutorials on c++ and c programming..[/QUOTE] Look at the firs thread in this forum. For [URL="http://www.daniweb.com/techtalkforums/thread50370.html"]example this (for C)[/URL] | |
Re: This is not enoughf information. Post your code. | |
Re: [QUOTE=djskip;262867][COLOR=#000000]Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of services: regular and premium. Its rates vary depending on the type of service. The rates are as follows:[/COLOR] [COLOR=#000000]Regular service: $10.00 plus first 50 minutes are free. Charges for over … | |
Re: [QUOTE=slacke;261927]Hello I'm working on an application. I need as big arrays as possible. At home I work with linux there I can declare array as big as this: char buffer[1000000]. No probleme. In work I'm working with boreland C++ 4.5 (WinXp) and I can't declare biger size of array as … | |
Re: [QUOTE=hazdude;262655]can anyone help me with some c++ coding? I want to create a piece of code that would allow me to type in any random 30 numbers and for them to come out in ascending order. Any help would be greatly appreciated Hazdude[/QUOTE] Try it and then post it. EDIT: … | |
Re: [QUOTE=kararu;262569]I am starting to use GDB, It can take in only executable form programs as argument is it? Or there are other options. I need to use gdb on a non-exe program directly.Can I do it?[/QUOTE] Read the manual, but I think it takes only the executable (*.out, offcourse you … | |
Re: [URL="http://www.daniweb.com/search/search.php?domains=www.daniweb.com&q=pascal%20triangles&sitesearch=www.daniweb.com&client=pub-8426641637123945&forid=1&ie=UTF-8&oe=UTF-8&flav=0000&sig=Au_QpLTb4IAmuMq6&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23FFFFFF%3BVLC%3A0033CC%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3AFFFFFF%3BALC%3A0033CC%3BLC%3A0033CC%3BT%3A444444%3BGFNT%3A0033CC%3BGIMP%3A0033CC%3BFORID%3A11&hl=en"]link[/URL]. EDIT: Your code can not be compiled, remove the errors. | |
Re: [QUOTE=darkeinjel04;262223]Here's my Prog...i dunno how 2 convert it...pls check.. its a pyramid... #[code] #include<stdio.h> main() { int a, b, c, d=0; clrscr(); printf("Enter a No:"); scanf("%d",&c); for(a=1;a<=c;a++) { for(b=1;b<=c*2-1;b++) if (b<=c+d&&b>=c-d) printf("*"); else printf(" "); printf("\n"); d++; } getch(); } [/code] is my program correct? the output must be..a pyramid[/QUOTE] … | |
Re: [QUOTE=shadowmoon;261700]i cant get this to work for an midi i have... can sumone code this to work for it? or possibly a while nnew code that works... heres the 1 i am using.. [code] #include <iostream> #include <windows.h> // for PlaySound() #define SND_FILENAME 0x20000 #define SND_LOOP 8 #define SND_ASYNC 1 … | |
Re: [QUOTE=sulymani;261694]Hello guys, I am taking the MIPS assembly course this semester. indeed, I am struggling with this course. any way i need ur help .. My guestion is how to make the output appears right justified and how to connect the previous functions to the new function which is the … | |
Re: [QUOTE=jeffssmith;261745]I'm taking CSCI 230 and was able to get a triangle to print with the following code. I can't get anything to work for a circle or rectangle (similar in size). Can anyone help? Thanks. #include <stdio.h> int main() { int t; int x = 0; int y; t = … | |
Re: Use code tags and read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]this[/URL] | |
Re: [QUOTE=Anonymusius;261215]You have included header.h twice (In both files). Use some sort code like of this (might be C++, sorry) [code]#ifndef HEADER #define HEADER #include "header.h" #endif[/code] But I dunno wether that is the real problem[/QUOTE] Its better in *.h file to do the protection [code] /********** * header.h file ***********/ … | |
Re: Hm did U got corrupted code and your task is to fix it? No?!?! Ok then just remove [inlinecode];[/inlinecode] after while loop. | |
Re: Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351"]this[/URL] | |
Re: No it dose not exist. Replace it with [code] do { /* your code going here */ } while(a<b); [/code] | |
Re: [QUOTE=rowly;260158]Hi, can any one tell me what size_t_count does, i couldnt get it . thanks guyz ! [code] fwrite([COLOR=#0000ff]const[/COLOR] [COLOR=#0000ff]void[/COLOR]*_str,size_t_Size,size_t_count,file *_File); [/code][/QUOTE] It means how many of size_t_Size you want to write. [inlinecode]fwrite(buff, sizeof(int), 4, someFile)[/inlinecode] means you want to write four ints to file. | |
Re: [QUOTE=joem1973;260513]hi every one!! can anyone send me a sample program that creates a different beep sounds.. meaning by pressing diffrent letter, a diffrent tone sounds.. beep of diffrent frequency...[/QUOTE] Against rules dude. Which language? | |
Re: [QUOTE=hano;260565]hi iface aproblem in c program i want to write aprogram to read R={(1,2),(2,1),(3,3),......} then covert it to matrix0/1 please help me quickly[/QUOTE] You need to performulate. Don't understand. You need arrays of rows? ![]() | |
Re: U wrote this code and U have bracket problem :rolleyes: ? If U want to compile this code remove two brackets in front of while loop. Your problem not ends here. Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048377843&id=1043284385"]this[/URL]. There are more problems but first do this. | |
Re: Ok in subtotal function you are not adding the value of the fifth item. Now if you can, try to avoid globals, use them only if you must . Read this [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044652485&id=1043284385"]link[/URL] for string input (don't get me wrong your prog is working with scanf but read the link). PS: … | |
Re: [QUOTE=tlly;259455]Thanks mate...but i need the solution in c++...is it posible??...sory for not specifying this at the start[/QUOTE] Well this code is more C++ than C becouse in C you dont have string, only if you defined it explicitly as struct |
The End.