Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~11.4K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Ararat

I'm trying to compare the element pointed by an iterator to an integer, but so far i haven't had any luck in doing so. please correct whatever i'm doing wrong. Thank you. vector<int>::iterator y; for (int i = 0;i<n2;i++) { cin>>temp; cnt = 0; y = lower_bound(a.begin(),a.end(),temp); if (*y == …

Member Avatar for Ararat
0
1K
Member Avatar for Ararat

I feel really dumb asking this, but why does this code print b,b instead of b,a? the second strcpy() is supposed to copy "a" and put it inside a[1]... [CODE]#include <stdio.h> #include <string.h> int main(){ char a[100][100] = {"a","b","c","d"}; char*temp = a[0]; strcpy(a[0],a[1]); strcpy(a[1],temp); printf ("%s %s",a[0],a[1]); getchar(); }[/CODE]

Member Avatar for Ararat
0
110
Member Avatar for Ararat

Hey guys I'm having a little problem with reading from a text file, here's how the text is formatted: [QUOTE]random string$52$44$5$abc random string$52$44$5$abc_def random string$52$44$5$abc_defgh[/QUOTE] this code is what I use to read the text [CODE]#include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> char name[100][100]; char position [100][100]; …

Member Avatar for WaltP
0
145
Member Avatar for Ararat

Hi guys i have a problem with my code :[CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> #include <conio.h> struct blahblah { char id[11]; char name[30]; float gpa; }lol[100]; int main(){ int count = 0; char name [50][100] ; for(int i =0;i<=4;i++){ printf ("Student %d\n",i+1); printf ("ID: "); gets(lol[i].id); printf("Name: "); gets(lol[i].name); printf ("GPA …

Member Avatar for Ararat
0
301
Member Avatar for Ararat

Hi, i want to make a program that lets the user input as many numbers as they like and terminates when the user enters "EXIT" and prints the largest & smallest input, heres my code: [CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> int main (){ int input; int min,max,a=0; char exit[] = "EXIT"; …

Member Avatar for prakash2813
0
1K
Member Avatar for Ararat

is it possible to make scanf not go into a newline after printf? [CODE]#include <stdio.h> #include <conio.h> int main(){ int a; scanf("%d",&a); printf ("%d",a); getch(); }[/CODE] output(suppose a is 5) :[CODE]5 5[/CODE] i want to print them in the same line like this [CODE]5 5[/CODE] how do i do that?

Member Avatar for DJSAN10
0
8K