Click here to Skip to main content
14,935,564 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionState Machine to C code and back Pin
NelsonGoncalves14-Jan-21 0:30
MemberNelsonGoncalves14-Jan-21 0:30 
AnswerRe: State Machine to C code and back Pin
Richard Andrew x6418-Jan-21 12:11
professionalRichard Andrew x6418-Jan-21 12:11 
GeneralRe: State Machine to C code and back Pin
NelsonGoncalves18-Jan-21 23:09
MemberNelsonGoncalves18-Jan-21 23:09 
AnswerRe: State Machine to C code and back Pin
trønderen20-Jan-21 9:29
Membertrønderen20-Jan-21 9:29 
GeneralRe: State Machine to C code and back Pin
NelsonGoncalves21-Jan-21 21:17
MemberNelsonGoncalves21-Jan-21 21:17 
GeneralRe: State Machine to C code and back Pin
Member 798912221-Jan-21 23:31
MemberMember 798912221-Jan-21 23:31 
GeneralRe: State Machine to C code and back Pin
Greg Utas22-Jan-21 1:30
mvaGreg Utas22-Jan-21 1:30 
QuestionC++ template function returning "vector" ? Pin
Member 1496877112-Jan-21 11:59
MemberMember 1496877112-Jan-21 11:59 
I am trying to get comfortable using "vector".
I have a function "returning" hardware parameters I need to process further "upstream" -
including "main".


I can pass a vector <string> by reference or have been told to define "local vector" and "return" if from the function.

I am not sure how "return vector" really works and have not tried it yet.

The function returning "vector <string> " syntax is scary...

Could I return pointer to locally defined vector ?
( Or is is even feasible ?)

Is there a specific resource I could read ?

Something similar to this example , but with "return * vector - string "?

<pre>
// C++ program to demonstrate how vectors 
// can be passed by reference. 
#include<bits/stdc++.h> 
using namespace std; 
   
// The vect is passed by reference and changes 
// made here reflect in main() 
void func(vector<int> &vect) 
{ 
   vect.push_back(30); 
} 
   
int main() 
{ 
    vector<int> vect; 
    vect.push_back(10); 
    vect.push_back(20); 
   
    func(vect); 
  
    for (int i=0; i<vect.size(); i++) 
       cout << vect[i] << " "; 
   
    return 0; 
} 





AnswerRe: C++ template function returning "vector" ? Pin
Greg Utas12-Jan-21 12:24
mvaGreg Utas12-Jan-21 12:24 
AnswerRe: C++ template function returning "vector" ? Pin
CPallini12-Jan-21 21:20
mveCPallini12-Jan-21 21:20 
GeneralRe: C++ template function returning "vector" ? Pin
Member 1496877113-Jan-21 4:57
MemberMember 1496877113-Jan-21 4:57 
GeneralRe: C++ template function returning "vector" ? Pin
Richard MacCutchan13-Jan-21 5:40
mveRichard MacCutchan13-Jan-21 5:40 
GeneralRe: C++ template function returning "vector" ? Pin
CPallini13-Jan-21 7:05
mveCPallini13-Jan-21 7:05 
QuestionCCombox Pin
JM225111-Jan-21 20:19
MemberJM225111-Jan-21 20:19 
AnswerRe: CCombox Pin
Richard MacCutchan11-Jan-21 22:41
mveRichard MacCutchan11-Jan-21 22:41 
QuestionCMFCRibbonComboBox Pin
Member 1325158811-Jan-21 16:31
MemberMember 1325158811-Jan-21 16:31 
AnswerRe: CMFCRibbonComboBox Pin
Richard MacCutchan11-Jan-21 22:39
mveRichard MacCutchan11-Jan-21 22:39 
GeneralRe: CMFCRibbonComboBox Pin
Member 1325158812-Jan-21 9:18
MemberMember 1325158812-Jan-21 9:18 
GeneralRe: CMFCRibbonComboBox Pin
Victor Nijegorodov12-Jan-21 10:12
MemberVictor Nijegorodov12-Jan-21 10:12 
GeneralRe: CMFCRibbonComboBox Pin
Member 1325158812-Jan-21 16:23
MemberMember 1325158812-Jan-21 16:23 
GeneralRe: CMFCRibbonComboBox Pin
Victor Nijegorodov12-Jan-21 21:07
MemberVictor Nijegorodov12-Jan-21 21:07 
GeneralRe: CMFCRibbonComboBox Pin
Richard MacCutchan12-Jan-21 21:24
mveRichard MacCutchan12-Jan-21 21:24 
QuestionC Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 10:49
Memberjackngill11-Jan-21 10:49 
QuestionRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
David Crow11-Jan-21 16:36
MemberDavid Crow11-Jan-21 16:36 
AnswerRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 22:25
Memberjackngill11-Jan-21 22:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.