Search Results

Showing results 1 to 27 of 27
Search took 0.01 seconds.
Search: Posts Made By: cusado
Forum: C Dec 16th, 2008
Replies: 1
Views: 358
Posted By cusado
when i try to do the following,


double root_value, c;
int d;
d=0;

printf("%.0f", root_value);
for(c=2; c<root_value;c++)
{
Forum: C Dec 16th, 2008
Replies: 4
Views: 883
Posted By cusado
well basically im writing to file with this
while(fgets(prime, 2000, fin)!=NULL) {
root_value = atof(prime);

fprintf(fout, "%.0f\t", root_value);
}

now i...
Forum: C Dec 16th, 2008
Replies: 4
Views: 883
Posted By cusado
im trying to right align data that i have written to file with fprintf, but im not sure how i would do so in C. ive looked around and there are many solutions for C++ and C# but havent found one for...
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
but when i leave it as (filename,'w') and compile and run, the program notes a windows error and closes, and no file is generated
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
but i though the entry in fopen has to be a either in "" or predefined?


#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define INFILE "questions.txt"


int main(int argc, char...
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
well i used


fout = fopen("%s.txt", "w");

but how do i represet "%s.txt" as the user's input?
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
well all i want to do is for the user to input a name or number and for the program to create a text file with that name. im not actually writing anything into the file, its just an empty .txt file...
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
well the entirety is only

#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char *argv[]) {
char line[255];
fgets(line, 255, stdin);
char filename[80];...
Forum: C Feb 13th, 2007
Replies: 26
Views: 4,468
Posted By cusado
the program runs, but no output file is generated? am i missing a command still?

char line[255];
fgets(line, 255, stdin);
char filename[80];
sprintf(filename,"%s.txt",line);
Forum: C Feb 12th, 2007
Replies: 26
Views: 4,468
Posted By cusado
how to turn a user input into a text file for example user inputs 100 and the program creates a text file named 100.txt?
I have tried to work it out but it still doesnt work properly.
i used
...
Forum: C Feb 10th, 2007
Replies: 3
Views: 855
Posted By cusado
how do i make sure the student id becomes the output file name, and that the entered answers are printed into that specific file
Forum: C Feb 10th, 2007
Replies: 3
Views: 855
Posted By cusado
im making a program that:
-asks a user for their studentID and stores it as a string.
-opens questions.txt for reading
-prints to screen the question followed by each answer on a seperate line...
Forum: C Feb 10th, 2007
Replies: 1
Views: 1,108
Posted By cusado
writing part of a program where user inputs an ID and the program generates a .txt file with the ID name(numerical ID).

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define INFILE...
Forum: C Feb 3rd, 2007
Replies: 5
Views: 4,485
Posted By cusado
hi im still finishing a calculator program. the problem is i am wondering what command to use to break out of multiple loops. my code is

#include <stdio.h>
#include <ctype.h>
#include <math.h>...
Forum: C Feb 3rd, 2007
Replies: 10
Views: 4,326
Posted By cusado
Any idea on how to add an integer only mode? where it disregards any numbers after decimal
Forum: C Feb 2nd, 2007
Replies: 10
Views: 4,326
Posted By cusado
thanks! that helped out a lot
Forum: C Feb 2nd, 2007
Replies: 10
Views: 4,326
Posted By cusado
also, in pellesC i keep getting a POLINK: fatal error: Access is denied.
message, but if i put the same code in Dev-C++ it doesnt show up(im programming Dev-C++ in C as well)
Forum: C Feb 2nd, 2007
Replies: 10
Views: 4,326
Posted By cusado
Well the updated code is now

#include <stdio.h>
#include <ctype.h>
#include <math.h>

float do0p(char op, float acc, float num) {
switch (op) {
case '+' : return acc + num;
...
Forum: C Feb 2nd, 2007
Replies: 10
Views: 4,326
Posted By cusado
hm i changed the code and it complies now, but when i try to inter a number, an error appears
Forum: C Feb 2nd, 2007
Replies: 10
Views: 4,326
Posted By cusado
im writing a calculator program in c and having some trouble..
basically it needs to have + - / * ^ functions as well as an integer only mode

the code so far

#include <stdio.h>
#include...
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
nvm that doesnt work either
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
if i change getch() to getc(fin) it returns p-other wise the errors appear
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
which means theres no getch()
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
lol im using pellesC thats why
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
hmm looks that way but errors still come up:


D:\Program Files\PellesC\Projects\assignment2\main.c(37): error #1053: Disagreement in number of macro arguments.
D:\Program...
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
it helps..but the problem is with this it only prints 1 charc...
Forum: C Jan 26th, 2007
Replies: 12
Views: 2,344
Posted By cusado
im writing a program that opens a file, reads until it arrives at a colon, then jumps over the colon and reads the number after the colon
the txt file contains

pi:3.14159
feetPerMile:5280...
Showing results 1 to 27 of 27

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC