15,551 Topics

Member Avatar for
Member Avatar for moroccanplaya

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 …

Member Avatar for moroccanplaya
0
76
Member Avatar for tomtetlaw

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.

Member Avatar for tomtetlaw
0
95
Member Avatar for e!sa

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 (

Member Avatar for Sumanth13
-1
84
Member Avatar for sciprog1

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

Member Avatar for sciprog1
0
172
Member Avatar for dubery

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 …

Member Avatar for dvillase
0
115
Member Avatar for frankchester

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

Member Avatar for Perry31
0
242
Member Avatar for jt_murphree

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 …

0
56
Member Avatar for alexchen

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

Member Avatar for alexchen
0
132
Member Avatar for NinjaLink

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 …

Member Avatar for Perry31
0
256
Member Avatar for tomtetlaw

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 …

Member Avatar for tomtetlaw
0
158
Member Avatar for Fredszky

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

Member Avatar for vinitmittal2008
0
179
Member Avatar for kousamir

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 …

Member Avatar for kapilsolanki84
0
251
Member Avatar for westony

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!

Member Avatar for westony
0
100
Member Avatar for berwick53

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

Member Avatar for gerard4143
0
108
Member Avatar for papori

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

0
47
Member Avatar for dalaharp

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 …

Member Avatar for arielbernal
0
3K
Member Avatar for jeremy62

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

Member Avatar for darkbreaker
0
152
Member Avatar for quangvn

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 …

Member Avatar for Shankye
0
167
Member Avatar for westony

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))); } } …

Member Avatar for Shankye
0
106
Member Avatar for ExCard

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 …

Member Avatar for vinitmittal2008
0
97
Member Avatar for kalpana sathiya
Member Avatar for kalpana sathiya
0
66
Member Avatar for protas

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 …

Member Avatar for protas
0
134
Member Avatar for onus

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 …

0
83
Member Avatar for writt

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 …

Member Avatar for Ancient Dragon
0
109
Member Avatar for jeremy62

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 …

Member Avatar for Ancient Dragon
0
216
Member Avatar for bkoper16

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

Member Avatar for bkoper16
0
877
Member Avatar for harikrishna439

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

Member Avatar for sharathg.satya
0
108
Member Avatar for frankchester

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 …

Member Avatar for frankchester
1
38K
Member Avatar for ram619

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 …

Member Avatar for ram619
0
182
Member Avatar for jvill

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}; …

Member Avatar for erroldo
0
191

The End.