15,551 Topics
| |
hi i can copy text based files to other files but when it comes to images i cant copy them it gives me a distorted image. [CODE] printf("please give your archive a name:\n"); scanf("%s", &archive_name); create_pointer = fopen( archive_name, "wb"); printf("please type in the path for the file you want … | |
Is there a way to ensure that all un-initialized pointers automatically have the address 0x00000000? Sometimes they're being set to other addresses but still being unitialized, and they pass tests like if(!ptr), causing an unhandled access violation error. | |
ok here's the current situation:sprintf(blah, "%c%-.6s%c", QUOT, varName, QUOT);my question is, how can i use a variable instead of that 6 in there?because i'm supposed to print a whole bunch of strings with variable size ( | |
Hello Members, I am trying to understand the pipe() system call. I found this program online: [CODE] #include <unistd.h> #include <stdio.h> #define MSGSIZE 16 char msg1[] = "hello #1"; char msg2[] = "hello #2"; char msg3[] = "hello #3"; main() { char inbuf[MSGSIZE]; int p[2], j; /* open pipe */ … | |
Hi all I need to write a recursive function that displays every permitation of NxN numbers this example uses 3x3 and will display 0 1 0 1 1 0 2 1 0 0 2 0 1 2 0 2 2 0 0 0 1 1 0 1 2 0 1 … | |
When I run this program, and the file can be found, it works fine. However when the file is not there I get the error: Debug Assertion Failed! Expression (str != NULL) It seems to be a problem with the following loop as when its remove it works fine: [code=c] … | |
I am not sure if this is the right place to post this or not. I have a C application that I have written for linux that I would like to write a GUI for. I am trying to get up an running using GTK. Can anyone direct me to … | |
"Why does this not compile?" [CODE]int main(){ struct people{ char name[20]; short age; } people; struct people me; cout<<"Write your name"<<endl; gets(me.name); cout<<"How old are you"<<endl; gets(me.age);//error }[/CODE] | |
Hi I am trying to compile and run my prog3.c program, but I am getting the compiler errors below. I have tried to reference the information by doing #include "node0.c" etc., but no luck. Any ideas on how to fix this problem? I attached the files below that I am … | |
I am using Windows XP 32-bit, VC++ 2008 with OpenGL and the Windows API. When I run my program, it seems to work fine, but whenever I click anywhere on the title bar of the window, the program exits. I have no idea where to start to look for the … | |
Im trying to make my program to either open or create a file if it does not exist, in "C://". [code] printf("Filename: "); scanf("%s",filename); FILE *fil; fil=fopen(filename,"a+");[/code] This code opens or creates a file in the same folder as the program. What i want is something like this: [code] printf("Filename: … | |
Hello, i'm new to this forum and this's my 1st time posting a code. my issue is that i have a code that should read from a file called ( ex: word or text), but it does not read the file it jUst gives me the error (could not open … | |
Hi there guys, how the hell i am able to create a UNIX window, I mean i am pissed off from that console, and how can I use GTK ? Thanks in advance! | |
Hi i've just started to use constructors and I'm having some problems with the following code with data not saving(saving to the correct place) please Help :( [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> typedef struct details // struct for all data { char name[50][50]; char card[50][16]; long sort[50], … | |
hey, i create a segment , then i attach it to data space, now i want to put the array in this space what sould i do next? how to assign it into? int shmid , size=5; int *shm; int array[] = {1,2,3,4,5}; // Create the segment. if ((shmid = … | |
hi, i have to rotate an image. the image is stored in an image[rows][cols] array.. i am trying to rotate it using trignometric functions. i am not sure what happens when i rotate the image, does the address of the pixel vary or the value of the pixel vary. and … | |
Alright im trying to create a program that allows the user to input numbers into an array and then will take the average of all the numbers within the array but im getting very strange results any help is much appreciated [CODE]#include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) … | |
Hi, I'm a newbie to programming in general. I want create two functions to read and write dat from one file to another file. Function read will read dat from file to buffer, and funtion write these data from buffer to another file. These functions work parallel, it means: Function … | |
I have this code in here: [CODE]#include <stdio.h> #include <conio.h> #include <string.h> void array_input(int *a) { int i=0,n,p; printf("How many items you wanna input? : "); scanf("%d", &p); for(n = 0; n <= 99; n++) if(*(a+n) != 0) i++; for(i; i<(i+p); i++) { printf("Enter %d number:",i); scanf("%d", &(*(a+i))); } } … | |
hi guys i need some help can you guys help me at deleting nodes I'm not yet that good in linked list and I can only delete the first node but I can't delete nodes in the middle and at the last help please I'm making a student database where … | |
plz.. help me .. how to arrange the set words in aphabetical order in c.its confusing me | |
Hi Guys, Wanted some help with my code. This should be the OUTPUT. Enter the size of your array: (array size should be 1-100) Enter values of your array: x[0]= (any integer) x[1]= (any integer but not equal to the value of x[0]) x[2]= (any integer but not equal to … | |
I am trying to understand how can I make a graph in C. So I wrote some program. [CODE=c]#include "declarations.h" graph root = NULL; int main() { cgraph(); } void cgraph(void) { int n, choice, dir, count,sib; choice = 1; count = 1; graph priv, temp; printf("Printf we are making … | |
how to store the info of student in the linked list PROGRAMS 3 0.4 LABS 3 0.1 EXAMS 3 0.5 Student Student 1234 PROGRAMS 90 85 88 LABS 99 65 85 EXAMS 67 85 56 John lastname 3456 PROGRAMS 95 90 98 LABS 91 75 90 EXAMS 55 63 92 … | |
Im attempting to write a program that will accept seperate sales amounts from the user and then will total the sales and display both the total sales and the sales tax from the sales at the programs end, if you can provide any help or insight i would greatly appreciate … | |
I am doing a project where i have to insert a list of players and stats into a binary search tree Here is the project description For this final assignment, you will be creating a binary search tree. You will be able to utilize some of your previous assignment code, … | |
Can we print rational numbers instead of decimal ratios? for example, a=3; b=4; if we print a/b, we have to get 3/4 instead of 0.75 | |
Hi, I'm a newbie to programming in general and I'm really struggling with working out how on earth to do this! I am aware of how to open the stream and read the text file using fscanf, however I want to store the text in that file into a string … | |
Below shown is a simple C Code. The code which is troubling is in commented area (please remove comment symbol to run those lines, comment symbl is just here to highlight them), here there are two printf's in comment area......... the error is that both are getting executed continuously without … | |
I'm trying to write a program that will accept input from the user as sales, then it will total the sales and display both the total and the sales tax (total multiplied by .0825 [CODE] #include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) { /*initialize */ int a[SIZE]= {0}; … |
The End.