That's great. I've located the appropriate directory, and now my file operation works. Thanks a lot!
Type: Posts; User: Bakster
That's great. I've located the appropriate directory, and now my file operation works. Thanks a lot!
Hello, I recently got Visual C++ and I am having a problem with it. I have a text file I want to input into my program but I don't know the directory Visual C++ reads files from or how to find out....
OK, it works fine now, thanks a lot!
Here is my latest version:
#include "stdio.h"
#include "conio.h"
#include "string.h"
void enter(char lib[100][3][50]);
void findAuthor(char lib[100][3][50]);
void findTitle(char...
Well I don't really know any alternatives to read a character. The only other input function I am aware of is scanf.
Alright I went back to fgets() again, it seems to be in working order except for the getchar() problem, I still don't know where to place the while loop fragment.
I replaced the gets() with scanf and this is my new program:
#include "stdio.h"
#include "conio.h"
#include "string.h"
void enter(char lib[100][3][50]);
void findAuthor(char...
Thanks for all that information, dwks. My program now acts better than it did previously, but the program just prints all the options ("Enter the title: " etc.) after I select a menu choice without...
I rewrote the program:
#include "stdio.h"
#include "conio.h"
#include "string.h"
void enter(char c1[100][3][50]);
void findAuthor(char c2[100][3][50]);
void findTitle(char c3[100][3][50]);
I didn't think you could pass an array into a function, only a pointer. I previously tried indexing the pointer passed into the function like I would index an array, but that didn't compile either.
I have written what is my largest program to date, a simple library catalog:
#include "stdio.h"
#include "conio.h"
#include "string.h"
void enter(char *c1);
void findAuthor(char *c2);...
Thanks Drogin, but I have corrected my code and it now works as it should:
#include "stdio.h"
#include "string.h"
void mystrcat(char *first, char *second);
int main(void)
{
I thought you could use the name of an array without the index just like an ordinary pointer, but evidently this is not the case. I created another pointer like this
char *p;
p = result;
and...
Thanks, I made those edits to my code but I get exactly the same error when I try to compile it.
Hello, I am attempting to write a program in which I write my own version of the library function 'strcat' using pointers:
#include "stdio.h"
#include "string.h"
void mystrcat(char *first,...
It works now, thanks a lot :)
I tried:
__int64 f = 600851475143;
I get a compiler error saying 'integer constant is too large for "long" type'. Same for long long int.
I'm using Dev-C++, I assume that int64 and long...
I've succesfully written some code that prints out the prime factors of integers. It works succesfully for small-ish integers, but my task is to calculate the largest prime factors of 600851475143....
Yes I noticed that when I added the printf function MK27 posted, and edited my if condition:
if (current%2==0 && current < 4000000)
Didn't spot it by myself, hence the thread, but...
Ah yes, I see the problem now. Removing the '+' from '+=' on line 10 fixed it. Thanks a lot! :D
Yeah that would have been the smart thing to do. I'll get to work trying to fix it. Thanks!
Hello everybody, I'm pretty much a beginner at using C, so my problem shouldn't be too difficult for you to solve, I hope. I wrote this program to sum all the even numbers in the fibonacci sequence...