15,552 Topics
| |
I am writing code to open file and read info from that file to open other files, dont' know why it's only open the first file, not file after that THanks [CODE] /* strtok example */ #include <stdio.h> #include <string.h> #include <iostream> using namespace std; void remove ( char str[] … | |
I am writing a code to read file and output stuff for two files and combine them together... Don't know why they read good at the first file but wit the same code , it didn't show up for the second file Please help Thanks [CODE]#include <stdio.h> #include <string.h> #include … | |
Hello, I'm working on a litle program. While working I stumbeled upon some problems. I would like to check if two Arrays are equal to each other. I tried this one, but it didn't work properly. [CODE] int control(int x1,int y1,int x2, int y2)//x1,y1 and x2,y2 -> coordinates of a … | |
Here is the instruction to the assignment: [url]http://dl.dropbox.com/u/43732846/Instruction.txt[/url] I think I got up to the part to initialize array and set length to 0 but I'm not sure how to do a for loop to print. I tried like strlen(month), printf(month[i]), etc, but none of them seems to work. And … | |
Hi, is there anyone out there who has any little knowledge of how to got about getting ur program to read a .bmp file? Pls teach me or show me an example just about how to get ur program to read .bmp files Cheers Ming | |
Hello. I've been doing a small application that will go (using only unsigned integer values) from 0 to 4026531840 and print them out. My code is next: [CODE]#include <stdio.h> #include <inttypes.h> int main(void){ uint64_t cnt; for(cnt=0;cnt<=4026531840;cnt++){ printf("%d\n",cnt); } } [/CODE] The only problem that i have is the last numbers … | |
I have written a code for checking vfork in unix. But I am getting the ambiguous behavious. When I am using exit(0) in child process , output is fine i.e; output :- Before fork I am a child My name is parent child PID=> 23133 kValue => 2 ] But … | |
I cannot spot the issue and neither can VS2010/ VS11 Developer preview edition. The code runs perfectly until allocating memory for the double pointer new_matrix. The only reason I cannot find the problem is because I've allocated space for 3 other pointers successfully. I believe I have the syntax correct … | |
i have [CODE]program p1032; const n=10; num=4; var i:integer; a:array[1..n] of 1..n; procedure tipareste; var i:integer; begin for i:=1 to num do write(a[i],' '); writeln; end; procedure permuta(k:integer); var i,x:integer; begin if k=1 then tipareste else begin for i:=1 to k do begin x:=a[i];a[i]:=a[k];a[k]:=x; permuta(k-1); x:=a[i];a[i]:=a[k];a[k]:=x; end; end; end; begin … | |
[CODE]#include<stdio.h> #include<conio.h> int n,a[10]; void display(); void insert(int); int del(); int main() { int i,item=0,j; n=1; printf("enter the numbers:"); for(i=1;i<6;i++) scanf("%d",&a[i]); for(j=1;j<5;j++) { insert(a[j+1]); } } while(n>1) { item=del(); a[n+1]=item; } display(a); getch(); } void display() { int i; for(i=1;i<6;i++) { printf("%d ",a[i]); } } void insert(int item1) { int … | |
my problem is highly conceptual problem. when i write: node *new1=malloc(sizeof(node)); it works properly. but when i write : node *new1=malloc(sizeof(node*)); it starts giving errors. // node is the structure having a integer and pointer to itself. | |
Hi, To explain once my app is added to windows path you can simply call it from CMD and you know how when you run a console it opens up a default folder and you can navigate to a new on by using cd .. and cd path command. I … | |
hello there it my first thread on this forum. well i need some help. See i am thinking abt making my own video player not for any project kinda thing but for my wish and knowledge. I am good in C and java, with help of C i learnt c++ … | |
Hi, i am new to pthread area. i like to pass the dynamic argument into the thread function. example [CODE]function(void *value) { printf("%s",(char *)value); }[/CODE] here i like to pass dynamic argument when thread is running. so is it possible in pthread? please share your ideas... | |
How can I check if my program was launched from the command line or from windows explorer? | |
Here is my code . Switch statement doesn't working in this. why? [CODE] int callprocess(FILE *File) { int Rec = 0; // record number char tcode[3]; //char buffer[30]; struct timeval b,e; long int tms,tme; do { printf("\nMenu :Init, Dummy, Add or Quit ( I, U, A or Q) : "); … | |
how convert this code into structure in c plz help me [CODE]class car { private: int x1,y1,x2,y2,col,col2,col3; public: car():x1(200),y1(300),x2(270),y2(200),col(4) {} car(int a,int b,int c,int d,int e,int f,int g):x1(a),y1(b),x2(c),y2(d),col(e),col2(f),col3(g) {} }[/CODE] | |
I want to readfile and merge them all to the arraytotal array , It works fine for individual file, don't know why, it printed out some weird character for the final Thanks [CODE]#include <stdio.h> #include <string.h> #include <stdio.h> #include <stdlib.h> using namespace std; #include <iostream> void fnSortHeap(char array[], int arr_ubound); … | |
I want to open different file names, at first it work well on couple files, but it has to be in order, what if i open random file like fall01, fall05,srping09 etc Thanks [CODE]#include <stdio.h> #include <string.h> #include <stdio.h> #include <stdlib.h> using namespace std; #include <iostream> int main() { FILE … | |
Hey, I need to make a function that returns an array. How would I do so? And how would I make a variable that gets all the values in that function? Thanks, you guys :) | |
//take mob.no ,name ,bill amt #include<stdio.h> #include<conio.h> #include<string.h> struct mob1 { char mob[10]; char name[10]; float bill; }; int main() { struct mob1 a[30]={{'\0'},{'\0'},0.0}; void accept(struct mob1 a[30],int n); void display(struct mob1 a[30],int n); int append(struct mob1 a[30],int n); void selmob(struct mob1 a[30],int n); void srch(struct mob1 a[30],char [],int,int); void … | |
How to find size of a semaphore object in windows? I tried using sizeof() but we cannot give name of the sempahore object as an argument to sizeof. It has to be the handle. sizeof(HANDLE) gives us the size of handle and not semaphore. | |
| This is what my professor provided me in his own words. "Write a program that copies the contents of a text file specified by the user and copies it to another text file "copy.txt". No line in the file is expected to be longer than 256 characters." Here is part … |
Hey I am using SHLoadImageFile API ,but i am facing prob in loading images (jpeg) of bigger size. Can anyone help me to solve this? | |
i'm new to this c programming. all i wanna do is to make the user to enter the number of student, then input the name and address of the student. later i want it to print the name and the address. the program crashes after i input all the name … | |
hey, i wanna know what is your idea on making program using C. the program must consist all of the basic until array. any great idea? just learning function but still not understand about it. thank you :) | |
I am not getting all numbers but only last number while readind data from file. And it has to be done with fscanf function.[code]/* input n nunbers fom user and write it in the file.find it's sum and write the ans. in another file */ #include <stdio.h> #include <conio.h> void … | |
Hi, How can I add the values of an array to a char variable? Without using "strcat" btw. [CODE]char table[5],message; t[0] = "h"; t[1] = "e"; t[2] = "l"; t[3] = "l"; t[4] = "o";[/CODE] Than end up with "message = "hello""? Thanks. | |
[code]int Add(int nX, int nY) { return nX + nY; } int main() { int (*pFcn)(int, int) = Add; int (*pFcn)(int, int) = &Add; cout << pFcn(5, 3) << endl; // add 5 + 3 return 0; } [/code] my question is are both of these lines equivalent? or is … | |
when it was all right suddenly when i try to compile and run a code display me this problem [QUOTE][IMG]http://img191.imageshack.us/img191/2909/captureyty.png[/IMG][/QUOTE] because i used to use DevC i never find this kind of problem, i search in to the MS visual folder in my pc but i dont find anything. DId … |
The End.