188 Posted Topics

Member Avatar for Savage221

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]

Member Avatar for andor
0
90
Member Avatar for msohail83
Member Avatar for nithia

[code] hndl = fopen("file.txt", "r+"); fseek(hndl, 0, SEEK_END); fprintf(hndl, "some text"); fclose(hndl); [/code]

Member Avatar for may4life
0
91
Member Avatar for paradoxxx
Member Avatar for pointers

[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] .

Member Avatar for Salem
0
97
Member Avatar for mandanainred
Member Avatar for ~s.o.s~
0
107
Member Avatar for pointers

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.

Member Avatar for jim mcnamara
0
181
Member Avatar for mandanainred

Use code tags, please read [URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"]this[/URL]

Member Avatar for Nick Evan
0
127
Member Avatar for rati

[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.

Member Avatar for rati
0
112
Member Avatar for snedan

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.

Member Avatar for ~s.o.s~
0
100
Member Avatar for s88

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.

Member Avatar for s88
0
301
Member Avatar for pointers
Member Avatar for andor

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 …

Member Avatar for andor
0
119
Member Avatar for kissiwat
Member Avatar for Raj@web
Member Avatar for neeven
Member Avatar for Salem
0
287
Member Avatar for Lutzee

[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 …

Member Avatar for Salem
0
124
Member Avatar for tirivamwe

This is valid [inlinecode]if (strcmp(check->words,text)==0)[/inlinecode] and this is not [inlinecode]if (strcmp(check->words,text[30])==0)[/inlinecode]

Member Avatar for Nick Evan
0
130
Member Avatar for Eadams20

To many errors you have. Remove ; after [inlinecode]void gettradeIn( float& tradeIn)[/inlinecode]. Where [inlinecode]void getdownPayment(float& downPayment)[/inlinecode] func ends?

Member Avatar for Nick Evan
0
104
Member Avatar for tirivamwe
Member Avatar for aismm
Member Avatar for andor
0
218
Member Avatar for tehloki

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.

Member Avatar for tehloki
0
251
Member Avatar for Mr.UNOwen

[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 …

Member Avatar for TylerSBreton
0
120
Member Avatar for iubike

Check this [URL="http://www.daniweb.com/tutorials/tutorial45806.html"]link[/URL]

Member Avatar for iubike
0
133
Member Avatar for dhruvisinha
Re: Help

[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 …

Member Avatar for andor
0
97
Member Avatar for Mangai

For me there are much more errors. Are you shore that you posted the whole code?

Member Avatar for Mangai
0
221
Member Avatar for rowly

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.

Member Avatar for rowly
0
128
Member Avatar for jack19

[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]

Member Avatar for happygeek
0
97
Member Avatar for kararu
Member Avatar for djskip

[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 …

Member Avatar for DavidRyan
0
166
Member Avatar for slacke

[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 …

Member Avatar for ~s.o.s~
0
235
Member Avatar for hazdude
Re: C++

[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: …

Member Avatar for rowly
0
92
Member Avatar for kararu
Re: Gdb

[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 …

Member Avatar for jim mcnamara
0
85
Member Avatar for darkeinjel04

[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.

Member Avatar for Infarction
0
147
Member Avatar for darkeinjel04

[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] …

Member Avatar for darkeinjel04
0
414
Member Avatar for friendz_

[QUOTE=friendz_;261950]how proceed c programming in unix just for practicing.[/QUOTE] U can start [URL="http://www.google.com/search?hl=en&q=C+programming+unix&btnG=Google+Search"]here[/URL]

Member Avatar for Ancient Dragon
0
54
Member Avatar for shadowmoon

[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 …

Member Avatar for andor
0
485
Member Avatar for sulymani

[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 …

Member Avatar for andor
0
127
Member Avatar for jeffssmith

[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 = …

Member Avatar for andor
0
82
Member Avatar for highlanda

Use code tags and read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]this[/URL]

Member Avatar for andor
0
103
Member Avatar for amishosh

[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 ***********/ …

Member Avatar for Anonymusius
0
151
Member Avatar for boujibabe

Hm did U got corrupted code and your task is to fix it? No?!?! Ok then just remove [inlinecode];[/inlinecode] after while loop.

Member Avatar for ~s.o.s~
0
80
Member Avatar for SammyHasibi

Read [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351"]this[/URL]

Member Avatar for andor
0
249
Member Avatar for jan1024188

No it dose not exist. Replace it with [code] do { /* your code going here */ } while(a<b); [/code]

Member Avatar for jan1024188
0
79
Member Avatar for rowly

[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.

Member Avatar for rowly
0
355
Member Avatar for joem1973

[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?

Member Avatar for Evenbit
0
2K
Member Avatar for hano

[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?

Member Avatar for iamthwee
0
87
Member Avatar for phuduz

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.

Member Avatar for ~s.o.s~
0
102
Member Avatar for Seadragon

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: …

Member Avatar for secretunfold
0
91
Member Avatar for tlly

[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

Member Avatar for WaltP
0
107

The End.